public class GnuRSAPublicKey extends GnuRSAKey implements java.security.PublicKey, java.security.interfaces.RSAPublicKey
An object that encapsulates an RSA public key.
References:
Constructor and Description |
---|
GnuRSAPublicKey(java.math.BigInteger n,
java.math.BigInteger e)
Trivial constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Returns
true if the designated object is an instance of
this class and has the same RSA parameter values as this one. |
byte[] |
getEncoded(int format)
Returns the encoded form of this public key according to the designated
format.
|
static GnuRSAPublicKey |
valueOf(byte[] k)
A class method that takes the output of the
encodePublicKey()
method of an RSA keypair codec object (an instance implementing
IKeyPairCodec for RSA keys, and re-constructs an
instance of this object. |
getAlgorithm, getE, getEncoded, getFormat, getModulus, getN, getPublicExponent
public GnuRSAPublicKey(java.math.BigInteger n, java.math.BigInteger e)
Trivial constructor.
n
- the modulus.e
- the public exponent.public static GnuRSAPublicKey valueOf(byte[] k)
A class method that takes the output of the encodePublicKey()
method of an RSA keypair codec object (an instance implementing
IKeyPairCodec
for RSA keys, and re-constructs an
instance of this object.
k
- the contents of a previously encoded instance of this object.java.lang.ArrayIndexOutOfBoundsException
- if there is not enough bytes, in
k
, to represent a valid encoding of an instance of this object.java.lang.IllegalArgumentException
- if the byte sequence does not represent a
valid encoding of an instance of this object.public byte[] getEncoded(int format)
Returns the encoded form of this public key according to the designated format.
getEncoded
in class GnuRSAKey
format
- the desired format identifier of the resulting encoding.java.lang.IllegalArgumentException
- if the format is not supported.RSAKeyPairRawCodec
public boolean equals(java.lang.Object obj)
Returns true
if the designated object is an instance of
this class and has the same RSA parameter values as this one.
Copyright © 2025. All rights reserved.