public final class DSSASN1Utils extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
computeSkiFromCert(CertificateToken certificateToken) |
static org.bouncycastle.asn1.cms.AttributeTable |
emptyIfNull(org.bouncycastle.asn1.cms.AttributeTable original) |
static String |
extractAttributeFromX500Principal(org.bouncycastle.asn1.ASN1ObjectIdentifier identifier,
X500Principal x500PrincipalName) |
static Map<String,String> |
get(X500Principal x500Principal) |
static org.bouncycastle.asn1.x509.AlgorithmIdentifier |
getAlgorithmIdentifier(DigestAlgorithm digestAlgorithm)
Gets the ASN.1 algorithm identifier structure corresponding to a digest algorithm
|
static org.bouncycastle.asn1.ASN1Sequence |
getAsn1SequenceFromDerOctetString(byte[] bytes)
This method returns the
ASN1Sequence encapsulated in
DEROctetString. |
static byte[] |
getAsn1SignaturePolicyDigest(DigestAlgorithm digestAlgorithm,
byte[] policyBytes)
This method computes the digest of an ASN1 signature policy (used in CAdES)
TS 101 733 5.8.1 : If the signature policy is defined using ASN.1, then the hash is calculated on the value
without the outer type and length
fields, and the hashing algorithm shall be as specified in the field sigPolicyHash.
|
static byte[] |
getBEREncoded(org.bouncycastle.asn1.ASN1Encodable asn1Encodable)
This method returns BER encoded ASN1 attribute.
|
static List<String> |
getCAAccessLocations(CertificateToken certificate)
Gives back the CA URIs meta-data found within the given certificate.
|
static String |
getCanonicalizedName(org.bouncycastle.asn1.x509.GeneralNames generalNames)
This method can be removed the simple IssuerSerial verification can be
performed.
|
static CertificateToken |
getCertificate(org.bouncycastle.cert.X509CertificateHolder x509CertificateHolder) |
static List<CertificatePolicy> |
getCertificatePolicies(CertificateToken certToken) |
static List<String> |
getCrlUrls(CertificateToken certificateToken)
Gives back the
List of CRL URI meta-data found within the given X509 certificate. |
static Date |
getDate(org.bouncycastle.asn1.ASN1Encodable encodable) |
static byte[] |
getDEREncoded(org.bouncycastle.asn1.ASN1Encodable asn1Encodable)
This method returns DER encoded ASN1 attribute.
|
static byte[] |
getEncoded(org.bouncycastle.cert.ocsp.BasicOCSPResp basicOCSPResp) |
static byte[] |
getEncoded(org.bouncycastle.tsp.TimeStampToken timeStampToken)
Returns an ASN.1 encoded bytes representing the
TimeStampToken |
static List<String> |
getExtendedKeyUsage(CertificateToken certToken) |
static org.bouncycastle.cms.SignerInformation |
getFirstSignerInformation(org.bouncycastle.cms.CMSSignedData cms)
Returns the first
SignerInformation extracted from CMSSignedData. |
static String |
getHumanReadableName(CertificateToken cert) |
static org.bouncycastle.asn1.x509.IssuerSerial |
getIssuerSerial(CertificateToken certToken)
This method returns a new IssuerSerial based on the certificate token
|
static List<String> |
getOCSPAccessLocations(CertificateToken certificate)
Gives back the OCSP URIs meta-data found within the given X509 cert.
|
static List<String> |
getQCStatementsIdList(CertificateToken certToken)
Get the list of all QCStatement Ids that are present in the certificate.
|
static List<String> |
getQCTypesIdList(CertificateToken certToken)
Get the list of all QCType Ids that are present in the certificate.
|
static byte[] |
getSki(CertificateToken certificateToken)
This method returns SKI bytes from the certificate extension.
|
static byte[] |
getSki(CertificateToken certificateToken,
boolean computeIfMissing)
This method returns SKI bytes from certificate.
|
static String |
getSubjectCommonName(CertificateToken cert) |
static String |
getUtf8String(X500Principal x500Principal) |
static org.bouncycastle.cert.X509CertificateHolder |
getX509CertificateHolder(CertificateToken certToken)
Returns a
X509CertificateHolder encapsulating the given X509Certificate. |
static boolean |
hasIdPkixOcspNoCheckExtension(CertificateToken token)
Indicates if the revocation data should be checked for an OCSP signing certificate.
http://www.ietf.org/rfc/rfc2560.txt?number=2560 A CA may specify that an OCSP client can trust a responder for the lifetime of the responder's certificate. |
static boolean |
isASN1SequenceTag(byte tagByte) |
static boolean |
isEmpty(org.bouncycastle.asn1.cms.AttributeTable attributeTable) |
static boolean |
isExtendedKeyUsagePresent(CertificateToken certToken,
org.bouncycastle.asn1.ASN1ObjectIdentifier oid) |
static boolean |
isOCSPSigning(CertificateToken certToken)
Indicates that a X509Certificates corresponding private key is used by an authority to sign OCSP-Responses.
http://www.ietf.org/rfc/rfc3280.txt http://tools.ietf.org/pdf/rfc6960.pdf 4.2.2.2 {iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) keyPurpose(3) ocspSigning(9)} OID: 1.3.6.1.5.5.7.3.9 |
static <T extends org.bouncycastle.asn1.ASN1Primitive> |
toASN1Primitive(byte[] bytes)
This method returns
T extends ASN1Primitive created from array of bytes. |
static Date |
toDate(org.bouncycastle.asn1.ASN1GeneralizedTime asn1Date) |
static String |
toString(org.bouncycastle.asn1.ASN1OctetString value) |
public static <T extends org.bouncycastle.asn1.ASN1Primitive> T toASN1Primitive(byte[] bytes)
T extends ASN1Primitive created from array of bytes. The IOException is
transformed in DSSException.T - the expected return typebytes - array of bytes to be transformed to ASN1PrimitiveT extends ASN1Primitivepublic static byte[] getDEREncoded(org.bouncycastle.asn1.ASN1Encodable asn1Encodable)
IOException is
transformed in DSSException.asn1Encodable - asn1Encodable to be DER encodedpublic static byte[] getBEREncoded(org.bouncycastle.asn1.ASN1Encodable asn1Encodable)
IOException is
transformed in DSSException.asn1Encodable - asn1Encodable to be BER encodedpublic static byte[] getEncoded(org.bouncycastle.cert.ocsp.BasicOCSPResp basicOCSPResp)
public static Date toDate(org.bouncycastle.asn1.ASN1GeneralizedTime asn1Date)
public static String toString(org.bouncycastle.asn1.ASN1OctetString value)
public static byte[] getEncoded(org.bouncycastle.tsp.TimeStampToken timeStampToken)
TimeStampTokentimeStampToken - TimeStampTokenTimeStampToken @ if the TimeStampToken encoding failspublic static org.bouncycastle.asn1.ASN1Sequence getAsn1SequenceFromDerOctetString(byte[] bytes)
ASN1Sequence encapsulated in
DEROctetString. The DEROctetString is represented as
byte array.bytes - byte representation of DEROctetStringASN1Sequence @ in case of a decoding problempublic static byte[] getAsn1SignaturePolicyDigest(DigestAlgorithm digestAlgorithm, byte[] policyBytes)
digestAlgorithm - the digest algorithm to be usedpolicyBytes - the ASN.1 policy contentpublic static String getCanonicalizedName(org.bouncycastle.asn1.x509.GeneralNames generalNames)
generalNames - the generalNamespublic static org.bouncycastle.asn1.x509.AlgorithmIdentifier getAlgorithmIdentifier(DigestAlgorithm digestAlgorithm)
digestAlgorithm - the digest algorithm to encodepublic static boolean hasIdPkixOcspNoCheckExtension(CertificateToken token)
token - the certificate to be checkedpublic static List<CertificatePolicy> getCertificatePolicies(CertificateToken certToken)
public static List<String> getQCStatementsIdList(CertificateToken certToken)
certToken - the certificatepublic static List<String> getQCTypesIdList(CertificateToken certToken)
certToken - the certificatepublic static byte[] getSki(CertificateToken certificateToken)
certificateToken - the CertificateTokenpublic static byte[] getSki(CertificateToken certificateToken, boolean computeIfMissing)
certificateToken - CertificateTokencomputeIfMissing - if the extension is missing and computeIfMissing = true, it will compute the SKI value from the Public
Keypublic static byte[] computeSkiFromCert(CertificateToken certificateToken)
public static List<String> getCAAccessLocations(CertificateToken certificate)
certificate - the certificate token.public static List<String> getOCSPAccessLocations(CertificateToken certificate)
certificate - the cert token.public static List<String> getCrlUrls(CertificateToken certificateToken)
List of CRL URI meta-data found within the given X509 certificate.certificateToken - the cert token certificateList of CRL URI, or empty list if the extension is not presentpublic static boolean isOCSPSigning(CertificateToken certToken)
certToken - the certificate tokenpublic static boolean isExtendedKeyUsagePresent(CertificateToken certToken, org.bouncycastle.asn1.ASN1ObjectIdentifier oid)
public static org.bouncycastle.cert.X509CertificateHolder getX509CertificateHolder(CertificateToken certToken)
X509CertificateHolder encapsulating the given X509Certificate.certToken - the certificate to be encapsulatedpublic static CertificateToken getCertificate(org.bouncycastle.cert.X509CertificateHolder x509CertificateHolder)
public static org.bouncycastle.asn1.x509.IssuerSerial getIssuerSerial(CertificateToken certToken)
certToken - the certificate tokenpublic static Map<String,String> get(X500Principal x500Principal)
public static String getUtf8String(X500Principal x500Principal)
public static String extractAttributeFromX500Principal(org.bouncycastle.asn1.ASN1ObjectIdentifier identifier, X500Principal x500PrincipalName)
public static String getSubjectCommonName(CertificateToken cert)
public static String getHumanReadableName(CertificateToken cert)
public static org.bouncycastle.cms.SignerInformation getFirstSignerInformation(org.bouncycastle.cms.CMSSignedData cms)
SignerInformation extracted from CMSSignedData.cms - CMSSignedDataSignerInformationpublic static boolean isASN1SequenceTag(byte tagByte)
public static Date getDate(org.bouncycastle.asn1.ASN1Encodable encodable)
public static boolean isEmpty(org.bouncycastle.asn1.cms.AttributeTable attributeTable)
public static org.bouncycastle.asn1.cms.AttributeTable emptyIfNull(org.bouncycastle.asn1.cms.AttributeTable original)
public static List<String> getExtendedKeyUsage(CertificateToken certToken)
Copyright © 2019. All rights reserved.