org.bouncycastle.asn1.x509

Class SubjectPublicKeyInfo

Implemented Interfaces:
DEREncodable

public class SubjectPublicKeyInfo
extends ASN1Encodable

The object that contains the public key stored in a certficate.

The getEncoded() method in the public keys in the JCE produces a DER encoded one of these.

Constructor Summary

SubjectPublicKeyInfo(ASN1Sequence seq)
SubjectPublicKeyInfo(AlgorithmIdentifier algId, byte[] publicKey)
SubjectPublicKeyInfo(AlgorithmIdentifier algId, DEREncodable publicKey)

Method Summary

AlgorithmIdentifier
getAlgorithmId()
static SubjectPublicKeyInfo
getInstance(Object obj)
static SubjectPublicKeyInfo
getInstance(ASN1TaggedObject obj, boolean explicit)
DERObject
getPublicKey()
for when the public key is an encoded object - if the bitstring can't be decoded this routine throws an IOException.
DERBitString
getPublicKeyData()
for when the public key is raw bits...
DERObject
toASN1Object()
Produce an object suitable for an ASN1OutputStream.

Methods inherited from class org.bouncycastle.asn1.ASN1Encodable

equals, getDERObject, getEncoded, hashCode, toASN1Object

Constructor Details

SubjectPublicKeyInfo

public SubjectPublicKeyInfo(ASN1Sequence seq)


SubjectPublicKeyInfo

public SubjectPublicKeyInfo(AlgorithmIdentifier algId,
                            byte[] publicKey)


SubjectPublicKeyInfo

public SubjectPublicKeyInfo(AlgorithmIdentifier algId,
                            DEREncodable publicKey)

Method Details

getAlgorithmId

public AlgorithmIdentifier getAlgorithmId()


getInstance

public static SubjectPublicKeyInfo getInstance(Object obj)


getInstance

public static SubjectPublicKeyInfo getInstance(ASN1TaggedObject obj,
                                               boolean explicit)


getPublicKey

public DERObject getPublicKey()
            throws IOException
for when the public key is an encoded object - if the bitstring can't be decoded this routine throws an IOException.


getPublicKeyData

public DERBitString getPublicKeyData()
for when the public key is raw bits...


toASN1Object

public DERObject toASN1Object()
Produce an object suitable for an ASN1OutputStream.
 SubjectPublicKeyInfo ::= SEQUENCE {
                          algorithm AlgorithmIdentifier,
                          publicKey BIT STRING }
 
Overrides:
toASN1Object in interface ASN1Encodable