java.io.Serializable, java.security.Key, java.security.PublicKey, ASN1Valuepublic class SubjectPublicKeyInfo extends java.security.spec.X509EncodedKeySpec implements ASN1Value, java.security.PublicKey
java.security.PublicKey.| Modifier and Type | Class | Description |
|---|---|---|
static class |
SubjectPublicKeyInfo.Template |
| Constructor | Description |
|---|---|
SubjectPublicKeyInfo(java.security.PublicKey pubk) |
|
SubjectPublicKeyInfo(AlgorithmIdentifier algorithm,
BIT_STRING subjectPublicKey) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
encode(java.io.OutputStream ostream) |
Write this value's DER encoding to an output stream using
its own base tag.
|
void |
encode(Tag implicit,
java.io.OutputStream ostream) |
Write this value's DER encoding to an output stream using
an implicit tag.
|
java.lang.String |
getAlgorithm() |
|
AlgorithmIdentifier |
getAlgorithmIdentifier() |
|
byte[] |
getEncoded() |
|
BIT_STRING |
getSubjectPublicKey() |
|
Tag |
getTag() |
Returns the base tag for this type, not counting any tags
that may be imposed on it by its context.
|
static SubjectPublicKeyInfo.Template |
getTemplate() |
|
java.security.PublicKey |
toPublicKey() |
Creates a PublicKey from the public key information.
|
public static final Tag TAG
public SubjectPublicKeyInfo(AlgorithmIdentifier algorithm, BIT_STRING subjectPublicKey)
public SubjectPublicKeyInfo(java.security.PublicKey pubk)
throws InvalidBERException,
java.io.IOException
InvalidBERExceptionjava.io.IOExceptionpublic java.lang.String getAlgorithm()
getAlgorithm in interface java.security.KeygetAlgorithm in class java.security.spec.EncodedKeySpecpublic byte[] getEncoded()
getEncoded in interface java.security.KeygetEncoded in class java.security.spec.X509EncodedKeySpecpublic AlgorithmIdentifier getAlgorithmIdentifier()
public BIT_STRING getSubjectPublicKey()
public Tag getTag()
ASN1Valuepublic void encode(java.io.OutputStream ostream)
throws java.io.IOException
ASN1Valuepublic void encode(Tag implicit, java.io.OutputStream ostream) throws java.io.IOException
ASN1Valuepublic static SubjectPublicKeyInfo.Template getTemplate()
public java.security.PublicKey toPublicKey()
throws java.security.NoSuchAlgorithmException,
InvalidKeyFormatException
java.security.NoSuchAlgorithmException - If the cryptographic provider
does not recognize the algorithm for this public key.InvalidKeyFormatException - If the subjectPublicKey could
not be decoded correctly.