Package org.bouncycastle.bcpg
Class RSAPublicBCPGKey
- java.lang.Object
-
- org.bouncycastle.bcpg.BCPGObject
-
- org.bouncycastle.bcpg.RSAPublicBCPGKey
-
- All Implemented Interfaces:
BCPGKey,org.bouncycastle.util.Encodable
public class RSAPublicBCPGKey extends BCPGObject implements BCPGKey
base class for an RSA Public Key.
-
-
Constructor Summary
Constructors Constructor Description RSAPublicBCPGKey(java.math.BigInteger n, java.math.BigInteger e)RSAPublicBCPGKey(BCPGInputStream in)Construct an RSA public key from the passed in stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidencode(BCPGOutputStream out)byte[]getEncoded()return the standard PGP encoding of the key.java.lang.StringgetFormat()return "PGP"java.math.BigIntegergetModulus()java.math.BigIntegergetPublicExponent()
-
-
-
Constructor Detail
-
RSAPublicBCPGKey
public RSAPublicBCPGKey(BCPGInputStream in) throws java.io.IOException
Construct an RSA public key from the passed in stream.- Parameters:
in-- Throws:
java.io.IOException
-
RSAPublicBCPGKey
public RSAPublicBCPGKey(java.math.BigInteger n, java.math.BigInteger e)- Parameters:
n- the moduluse- the public exponent
-
-
Method Detail
-
getPublicExponent
public java.math.BigInteger getPublicExponent()
-
getModulus
public java.math.BigInteger getModulus()
-
getFormat
public java.lang.String getFormat()
return "PGP"- Specified by:
getFormatin interfaceBCPGKey- Returns:
- "RAW" or "PGP"
- See Also:
BCPGKey.getFormat()
-
getEncoded
public byte[] getEncoded()
return the standard PGP encoding of the key.- Specified by:
getEncodedin interfaceBCPGKey- Specified by:
getEncodedin interfaceorg.bouncycastle.util.Encodable- Overrides:
getEncodedin classBCPGObject- Returns:
- byte[]
- See Also:
BCPGKey.getEncoded()
-
encode
public void encode(BCPGOutputStream out) throws java.io.IOException
- Specified by:
encodein classBCPGObject- Throws:
java.io.IOException
-
-