Top Description Fields Constructors Methods
org.bouncycastle.crypto.asymmetric

public final Class AsymmetricXDHPublicKey

extends AsymmetricXDHKey
implements AsymmetricPublicKey
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.AsymmetricPublicKey, org.bouncycastle.crypto.AsymmetricKey, org.bouncycastle.crypto.Key
Imports
org.bouncycastle.crypto.Algorithm, .AsymmetricPublicKey, org.bouncycastle.crypto.general.EdEC, org.bouncycastle.util.Arrays, org.bouncycastle.util.encoders.Hex

Edwards Curve Diffie-Hellman (XDH) public keys.

Field Summary

Modifier and TypeField and Description
private final int
private final byte[]
private static final byte
pack-priv static final byte[]
private static final byte
pack-priv static final byte[]

Constructor Summary

AccessConstructor and Description
public
AsymmetricXDHPublicKey(Algorithm algorithm, byte[] keyData)

public
AsymmetricXDHPublicKey(byte[]
the DER encoding of the key.
encoding
)

Construct a key from an encoding of a SubjectPublicKeyInfo.

Method Summary

Modifier and TypeMethod and Description
private int
public boolean
equals(Object
object to compare to.
o
)

Overrides java.lang.Object.equals.

Implements org.bouncycastle.crypto.Key.equals.

Return true if o is an equivalent key to this.
public byte[]
getEncoded()

Implements org.bouncycastle.crypto.AsymmetricKey.getEncoded.

Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.
public byte[]
public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements org.bouncycastle.crypto.Key.hashCode.

Return the hashCode for the key.
Inherited from org.bouncycastle.crypto.asymmetric.AsymmetricXDHKey:
checkApprovedOnlyModeStatusgetAlgorithmzeroize

Field Detail

hashCodeback to summary
private final int hashCode
keyDataback to summary
private final byte[] keyData
x25519_typeback to summary
private static final byte x25519_type
x25519Prefixback to summary
pack-priv static final byte[] x25519Prefix
x448_typeback to summary
private static final byte x448_type
x448Prefixback to summary
pack-priv static final byte[] x448Prefix

Constructor Detail

AsymmetricXDHPublicKeyback to summary
public AsymmetricXDHPublicKey(Algorithm algorithm, byte[] keyData)
AsymmetricXDHPublicKeyback to summary
public AsymmetricXDHPublicKey(byte[] encoding)

Construct a key from an encoding of a SubjectPublicKeyInfo.

Parameters
encoding:byte[]

the DER encoding of the key.

Method Detail

calculateHashCodeback to summary
private int calculateHashCode()
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Implements org.bouncycastle.crypto.Key.equals.

Doc from org.bouncycastle.crypto.Key.equals.

Return true if o is an equivalent key to this.

Parameters
o:Object

object to compare to.

Returns:boolean

true if o is the same or equivalent key, false otherwise.

Annotations
@Override
getEncodedback to summary
public byte[] getEncoded()

Implements org.bouncycastle.crypto.AsymmetricKey.getEncoded.

Doc from org.bouncycastle.crypto.AsymmetricKey.getEncoded.

Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.

Returns:byte[]

an encoding of a PrivateKeyInfo or a SubjectPublicKeyInfo structure.

getPublicDataback to summary
public byte[] getPublicData()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements org.bouncycastle.crypto.Key.hashCode.

Doc from org.bouncycastle.crypto.Key.hashCode.

Return the hashCode for the key.

Returns:int

the key's hashCode.

Annotations
@Override