org.bouncycastle.asn1.x509

Class SubjectPublicKeyInfo

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(AlgorithmIdentifier algId, DEREncodable publicKey)
SubjectPublicKeyInfo(AlgorithmIdentifier algId, byte[] publicKey)
SubjectPublicKeyInfo(ASN1Sequence seq)
Method Summary
AlgorithmIdentifiergetAlgorithmId()
static SubjectPublicKeyInfogetInstance(ASN1TaggedObject obj, boolean explicit)
static SubjectPublicKeyInfogetInstance(Object obj)
DERObjectgetPublicKey()
for when the public key is an encoded object - if the bitstring can't be decoded this routine throws an IOException.
DERBitStringgetPublicKeyData()
for when the public key is raw bits...
DERObjecttoASN1Object()
Produce an object suitable for an ASN1OutputStream.

Constructor Detail

SubjectPublicKeyInfo

public SubjectPublicKeyInfo(AlgorithmIdentifier algId, DEREncodable publicKey)

SubjectPublicKeyInfo

public SubjectPublicKeyInfo(AlgorithmIdentifier algId, byte[] publicKey)

SubjectPublicKeyInfo

public SubjectPublicKeyInfo(ASN1Sequence seq)

Method Detail

getAlgorithmId

public AlgorithmIdentifier getAlgorithmId()

getInstance

public static SubjectPublicKeyInfo getInstance(ASN1TaggedObject obj, boolean explicit)

getInstance

public static SubjectPublicKeyInfo getInstance(Object obj)

getPublicKey

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

Throws: IOException - if the bit string doesn't represent a DER encoded object.

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 }