Package org.apache.wss4j.common.crypto
Class X509SubjectPublicKeyInfo
java.lang.Object
org.apache.wss4j.common.crypto.DERDecoder
org.apache.wss4j.common.crypto.X509SubjectPublicKeyInfo
Represents the X.509 SubjectPublicKeyInfo for a public key, as specified
in RFC3280/5280:
SubjectPublicKeyInfo ::= SEQUENCE {
algorithm AlgorithmIdentifier,
subjectPublicKey BIT STRING }
AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL }
-
Field Summary
Fields inherited from class org.apache.wss4j.common.crypto.DERDecoder
TYPE_BIT_STRING, TYPE_OBJECT_IDENTIFIER, TYPE_OCTET_STRING, TYPE_SEQUENCE -
Constructor Summary
ConstructorsConstructorDescriptionX509SubjectPublicKeyInfo(byte[] x509EncodedPublicKey) Construct a SubjectPublicKeyInfo for the given X.509-encoded public key.Construct a SubjectPublicKeyInfo for the given public key. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Get the subjectPublicKey element of the SubjectPublicKeyInfo.
-
Constructor Details
-
X509SubjectPublicKeyInfo
Construct a SubjectPublicKeyInfo for the given public key.- Parameters:
key- the public key.- Throws:
WSSecurityException- if the public key encoding format is not X.509 or the encoding is null.
-
X509SubjectPublicKeyInfo
Construct a SubjectPublicKeyInfo for the given X.509-encoded public key.- Parameters:
x509EncodedPublicKey- the public key, in X.509 DER-encoding.- Throws:
WSSecurityException- if the encoded public key is null.
-
-
Method Details
-
getSubjectPublicKey
Get the subjectPublicKey element of the SubjectPublicKeyInfo.- Returns:
- the X.509-encoded subjectPublicKey bit string.
- Throws:
WSSecurityException- the DER-encoding is invalid.
-