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.ASN1BitString, .ASN1Encodable, .ASN1EncodableVector, .ASN1Object, .ASN1Primitive, .ASN1Sequence, .ASN1TaggedObject, .DERBitString, .DERSequence

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

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 ASN1BitString

Constructor Summary

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

public
SubjectPublicKeyInfo(ASN1Sequence seq)

Deprecated use SubjectPublicKeyInfo.getInstance()

Method Summary

Modifier and TypeMethod and Description
public AlgorithmIdentifier
public AlgorithmIdentifier

Returns:

alg ID.
getAlgorithmId
()

Deprecated use getAlgorithm()
public static SubjectPublicKeyInfo
getInstance(ASN1TaggedObject obj, boolean explicit)

public static SubjectPublicKeyInfo
public ASN1Primitive

Returns:

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

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

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:
encodeToencodeToequalsgetEncodedgetEncodedhasEncodedTagValuehashCode

Field Detail

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

Constructor Detail

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

Deprecated

use SubjectPublicKeyInfo.getInstance()

Method Detail

getAlgorithmback to summary
public AlgorithmIdentifier getAlgorithm()
getAlgorithmIdback to summary
public AlgorithmIdentifier getAlgorithmId()

Deprecated

use getAlgorithm()

Returns:AlgorithmIdentifier

alg ID.

getInstanceback to summary
public static SubjectPublicKeyInfo getInstance(ASN1TaggedObject obj, boolean explicit)
getInstanceback to summary
public static SubjectPublicKeyInfo getInstance(Object obj)
getPublicKeyback to summary
public ASN1Primitive getPublicKey() throws IOException

Deprecated

use parsePublicKey

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.
getPublicKeyDataback to summary
public ASN1BitString getPublicKeyData()

for when the public key is raw bits.

Returns:ASN1BitString

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.