Package org.apache.wss4j.common.crypto
Class X509KeyIdentifierUtil
java.lang.Object
org.apache.wss4j.common.crypto.X509KeyIdentifierUtil
Decodes the X.509 key identifier extensions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]Read the keyIdentifier of the AuthorityKeyIdentifier extension (2.5.29.35) of the given certificate.static byte[]Read the SubjectKeyIdentifier extension (2.5.29.14) of the given certificate.
-
Method Details
-
getAuthorityKeyIdentifierBytes
Read the keyIdentifier of the AuthorityKeyIdentifier extension (2.5.29.35) of the given certificate.X.509 extensions are required to use DER; BER encodings are rejected.
- Parameters:
cert- the certificate to read the AuthorityKeyIdentifier from.- Returns:
- an empty array if the certificate has no AuthorityKeyIdentifier extension, null if the extension is present but carries no keyIdentifier, otherwise the keyIdentifier.
- Throws:
IllegalArgumentException- if the extension is present but is not valid DER.
-
getSubjectKeyIdentifierBytes
Read the SubjectKeyIdentifier extension (2.5.29.14) of the given certificate.X.509 extensions are required to use DER; BER encodings are rejected.
- Parameters:
cert- the certificate to read the SubjectKeyIdentifier from.- Returns:
- an empty array if the certificate has no SubjectKeyIdentifier extension, otherwise the key identifier.
- Throws:
IllegalArgumentException- if the extension is present but is not valid DER.
-