APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.x509

public final Class NamedX509Key

extends X509Key
Class Inheritance
Imports
sun.security.util.BitArray, java.io.IOException, .InvalidObjectException, .ObjectInputStream, .Serial, java.security.InvalidKeyException, .KeyRep, .NoSuchAlgorithmException, .ProviderException, java.security.spec.NamedParameterSpec

Represents a public key from an algorithm family that is specialized with a named parameter set.

This key is generated by either a sun.security.provider.NamedKeyPairGenerator or sun.security.provider.NamedKeyFactory. Its getAlgorithm method returns the algorithm family name, while its getParams() method returns the parameter set name as a NamedParameterSpec object. The algorithm identifier in the X.509 encoding of the key is always a single OID derived from the parameter set name.

See Also
sun.security.provider.NamedKeyPairGenerator

Field Summary

Modifier and TypeField and Description
private final String
private final transient NamedParameterSpec
private final byte[]
private static final long
Inherited from sun.security.x509.X509Key:
algidencodedKey

Constructor Summary

AccessConstructor and Description
public
NamedX509Key(String fname, String pname, byte[] rawBytes)

Ctor from family name, parameter set name, raw key bytes.

public
NamedX509Key(String fname, byte[] encoded)

Ctor from family name, and X.509 bytes.

Method Summary

Modifier and TypeMethod and Description
public String
getAlgorithm()

Overrides sun.security.x509.X509Key.getAlgorithm.

Implements java.security.Key.getAlgorithm.

Returns the algorithm to be used with this key.

public NamedParameterSpec
getParams()

Overrides default java.security.AsymmetricKey.getParams.

Returns the parameters associated with this key.

public byte[]
getRawBytes()

Returns the reference to the internal key.

private void
public String
toString()

Overrides sun.security.x509.X509Key.toString.

Returns a string representation of the object.

private Object
Inherited from sun.security.x509.X509Key:
buildX509KeydecodedecodeencodeencodeencodeequalsgetAlgorithmIdgetEncodedgetFormatgetKeygetKeyAsByteshashCodeparseparseKeyBitssetKey

Field Detail

fnameback to summary
private final String fname
paramSpecback to summary
private final transient NamedParameterSpec paramSpec
rawBytesback to summary
private final byte[] rawBytes
serialVersionUIDback to summary
private static final long serialVersionUID

Hides sun.security.x509.X509Key.serialVersionUID, java.security.PublicKey.serialVersionUID.

Annotations
@Serial

Constructor Detail

NamedX509Keyback to summary
public NamedX509Key(String fname, String pname, byte[] rawBytes)

Ctor from family name, parameter set name, raw key bytes. Key bytes won't be cloned, caller must relinquish ownership

NamedX509Keyback to summary
public NamedX509Key(String fname, byte[] encoded) throws InvalidKeyException

Ctor from family name, and X.509 bytes. Input byte array is copied. Caller can modify it after the method call.

Method Detail

getAlgorithmback to summary
public String getAlgorithm()

Overrides sun.security.x509.X509Key.getAlgorithm.

Implements java.security.Key.getAlgorithm.

Doc from sun.security.x509.X509Key.getAlgorithm.

Returns the algorithm to be used with this key.

Annotations
@Override
getParamsback to summary
public NamedParameterSpec getParams()

Overrides default java.security.AsymmetricKey.getParams.

Doc from java.security.AsymmetricKey.getParams.

Returns the parameters associated with this key. The parameters are optional and may be either explicitly specified or implicitly created during key pair generation.

Annotations
@Override
getRawBytesback to summary
public byte[] getRawBytes()

Returns the reference to the internal key. Caller must not modify the content or keep a reference.

readObjectback to summary
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException

Hides sun.security.x509.X509Key.readObject.

Doc from sun.security.x509.X509Key.readObject.

Serialization read ... X.509 keys serialize as themselves, and they're parsed when they get read back.

Annotations
@Serial
toStringback to summary
public String toString()

Overrides sun.security.x509.X509Key.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
writeReplaceback to summary
private Object writeReplace() throws ObjectStreamException
Annotations
@Serial