Top Description Fields Constructors Methods
org.bouncycastle.asn1.x509

public Class SubjectPublicKeyInfo

extends ASN1Object
Class Inheritance
Imports
java.io.IOException, java.util.Enumeration, org.bouncycastle.asn1.ASN1Encodable, .ASN1EncodableVector, .ASN1Object, .ASN1Primitive, .ASN1Sequence, .ASN1TaggedObject, .DERBitString, .DERSequence

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.

Field Summary

Modifier and TypeField and Description
private AlgorithmIdentifier
private DERBitString

Constructor Summary

AccessConstructor and Description
public
public
SubjectPublicKeyInfo(AlgorithmIdentifier algId, byte[] publicKey)

private

Method Summary

Modifier and TypeMethod and Description
public AlgorithmIdentifier
public static SubjectPublicKeyInfo
getInstance(ASN1TaggedObject obj, boolean explicit)

public static SubjectPublicKeyInfo
public DERBitString

Returns:

the public key as the raw bit string...
getPublicKeyData
()

for when the public key is raw bits.

public ASN1Primitive

Returns:

the public key as an ASN.1 primitive.
parsePublicKey
()

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

public ASN1Primitive
toASN1Primitive()

Implements abstract org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Produce an object suitable for an ASN1OutputStream.
Inherited from org.bouncycastle.asn1.ASN1Object:
equalsgetEncodedgetEncodedhasEncodedTagValuehashCode

Field Detail

algIdback to summary
private AlgorithmIdentifier algId
keyDataback to summary
private DERBitString keyData

Constructor Detail

SubjectPublicKeyInfoback to summary
public SubjectPublicKeyInfo(AlgorithmIdentifier algId, ASN1Encodable publicKey) throws IOException
SubjectPublicKeyInfoback to summary
public SubjectPublicKeyInfo(AlgorithmIdentifier algId, byte[] publicKey)
SubjectPublicKeyInfoback to summary
private SubjectPublicKeyInfo(ASN1Sequence seq)

Method Detail

getAlgorithmback to summary
public AlgorithmIdentifier getAlgorithm()
getInstanceback to summary
public static SubjectPublicKeyInfo getInstance(ASN1TaggedObject obj, boolean explicit)
getInstanceback to summary
public static SubjectPublicKeyInfo getInstance(Object obj)
getPublicKeyDataback to summary
public DERBitString getPublicKeyData()

for when the public key is raw bits.

Returns:DERBitString

the public key as the raw bit string...

parsePublicKeyback to summary
public ASN1Primitive parsePublicKey() throws IOException

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

Returns:ASN1Primitive

the public key as an ASN.1 primitive.

Exceptions
IOException:
- if the bit string doesn't represent a DER encoded object.
toASN1Primitiveback to summary
public ASN1Primitive toASN1Primitive()

Implements abstract org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Produce an object suitable for an ASN1OutputStream.

SubjectPublicKeyInfo ::= SEQUENCE {
                         algorithm AlgorithmIdentifier,
                         publicKey BIT STRING }
Returns:ASN1Primitive

Doc from org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

a primitive representation of this object.