Search in sources :

Example 1 with RSAPublicKeyData

use of co.krypt.krypton.pgp.publickey.RSAPublicKeyData in project krypton-android by kryptco.

the class RSASSHKeyPair method pgpPublicKeyData.

@Override
public PublicKeyData pgpPublicKeyData() {
    RSAPublicKey rsaPub = (RSAPublicKey) keyPair.getPublic();
    byte[] n = rsaPub.getModulus().toByteArray();
    byte[] e = rsaPub.getPublicExponent().toByteArray();
    return new RSAPublicKeyData(new MPInt(n), new MPInt(e));
}
Also used : RSAPublicKeyData(co.krypt.krypton.pgp.publickey.RSAPublicKeyData) RSAPublicKey(java.security.interfaces.RSAPublicKey) MPInt(co.krypt.krypton.pgp.packet.MPInt)

Aggregations

MPInt (co.krypt.krypton.pgp.packet.MPInt)1 RSAPublicKeyData (co.krypt.krypton.pgp.publickey.RSAPublicKeyData)1 RSAPublicKey (java.security.interfaces.RSAPublicKey)1