org.apache.ws.security.components.crypto
Class X509SubjectPublicKeyInfo
java.lang.Object
org.apache.ws.security.components.crypto.DERDecoder
org.apache.ws.security.components.crypto.X509SubjectPublicKeyInfo
public class X509SubjectPublicKeyInfo
- extends DERDecoder
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 }
Method Summary |
byte[] |
getSubjectPublicKey()
Get the subjectPublicKey element of the SubjectPublicKeyInfo. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
X509SubjectPublicKeyInfo
public X509SubjectPublicKeyInfo(PublicKey key)
throws WSSecurityException
- 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
public X509SubjectPublicKeyInfo(byte[] x509EncodedPublicKey)
throws WSSecurityException
- 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.
getSubjectPublicKey
public byte[] getSubjectPublicKey()
throws WSSecurityException
- Get the subjectPublicKey element of the SubjectPublicKeyInfo.
- Returns:
- the X.509-encoded subjectPublicKey bit string.
- Throws:
WSSecurityException
- the DER-encoding is invalid.
Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.