public class CryptoServiceImpl extends Object implements CryptoService
| Constructor and Description |
|---|
CryptoServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
calcSha1(byte[] content) |
byte[] |
calcSha256(byte[] content) |
byte[] |
composeBodySha1(byte[] sign,
X509Certificate c,
byte[] origHash,
Date signingTime) |
byte[] |
composeBodySha256(byte[] sign,
X509Certificate c,
byte[] origHash,
Date signingTime) |
byte[] |
composeBodySha256(List<AppSignedInfo> listAsi) |
int |
doIt(String src) |
org.bouncycastle.asn1.DERTaggedObject |
extractDTOSignPolicyOid(byte[] sign,
SignCompare signCompare) |
String |
extractHashId(byte[] sign) |
byte[] |
extractSignature(byte[] sign) |
SignCompare |
extractSignCompare(byte[] sign) |
SignCompare2 |
extractSignCompare2(byte[] sign) |
SignPolicyRef |
extractVerifyRefence(byte[] policy) |
byte[] |
hashSignedAttribSha1(byte[] origHash,
Date signingTime,
X509Certificate x509) |
byte[] |
hashSignedAttribSha256(byte[] origHash,
Date signingTime,
X509Certificate x509) |
OperationStatus |
validateSign(byte[] signCms,
byte[] origHash,
Date dtSign,
boolean verifyCRL) |
boolean |
validateSignatureByPolicy(byte[] sign,
byte[] ps) |
boolean |
validateSignatureByPolicy(SignPolicyRef spr,
SignCompare sc) |
OperationStatus |
validateSignByContent(byte[] signCms,
byte[] content,
Date dtSign,
boolean verifyCRL) |
public int doIt(String src)
public byte[] hashSignedAttribSha1(byte[] origHash,
Date signingTime,
X509Certificate x509)
throws Exception
hashSignedAttribSha1 in interface CryptoServiceExceptionpublic byte[] hashSignedAttribSha256(byte[] origHash,
Date signingTime,
X509Certificate x509)
throws Exception
hashSignedAttribSha256 in interface CryptoServiceExceptionpublic byte[] extractSignature(byte[] sign)
throws Exception
extractSignature in interface CryptoServiceExceptionpublic SignCompare extractSignCompare(byte[] sign) throws Exception
extractSignCompare in interface CryptoServiceExceptionpublic SignCompare2 extractSignCompare2(byte[] sign) throws Exception
extractSignCompare2 in interface CryptoServiceExceptionpublic org.bouncycastle.asn1.DERTaggedObject extractDTOSignPolicyOid(byte[] sign,
SignCompare signCompare)
throws Exception
Exceptionpublic OperationStatus validateSignByContent(byte[] signCms, byte[] content, Date dtSign, boolean verifyCRL) throws Exception
validateSignByContent in interface CryptoServiceExceptionpublic OperationStatus validateSign(byte[] signCms, byte[] origHash, Date dtSign, boolean verifyCRL) throws Exception
validateSign in interface CryptoServiceExceptionpublic boolean validateSignatureByPolicy(SignPolicyRef spr, SignCompare sc)
validateSignatureByPolicy in interface CryptoServicepublic SignPolicyRef extractVerifyRefence(byte[] policy) throws IOException, ParseException
extractVerifyRefence in interface CryptoServiceIOExceptionParseExceptionpublic byte[] composeBodySha1(byte[] sign,
X509Certificate c,
byte[] origHash,
Date signingTime)
throws Exception
composeBodySha1 in interface CryptoServiceExceptionpublic byte[] composeBodySha256(byte[] sign,
X509Certificate c,
byte[] origHash,
Date signingTime)
throws Exception
composeBodySha256 in interface CryptoServiceExceptionpublic byte[] composeBodySha256(List<AppSignedInfo> listAsi) throws Exception
Exceptionpublic byte[] calcSha1(byte[] content)
throws NoSuchAlgorithmException
calcSha1 in interface CryptoServiceNoSuchAlgorithmExceptionpublic byte[] calcSha256(byte[] content)
throws NoSuchAlgorithmException
calcSha256 in interface CryptoServiceNoSuchAlgorithmExceptionpublic boolean validateSignatureByPolicy(byte[] sign,
byte[] ps)
throws Exception
validateSignatureByPolicy in interface CryptoServiceExceptionCopyright © 2020. All rights reserved.