in.s8.rsa.util.Exponent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of RSA-Encryption-Decryption Show documentation
Show all versions of RSA-Encryption-Decryption Show documentation
Project to RSA-encrypt-decrypt
The newest version!
package in.s8.rsa.util;
import in.s8.rsa.constant.S8Constant;
import javax.crypto.Cipher;
import java.security.interfaces.RSAPublicKey;
/**
* Created by Sourabh_Sethi on 4/26/2016.
*/
public class Exponent {
public static String getExponent( RSAPublicKey rsaPK) {
String exponent = null;
try {
// get an RSA cipher object and print the provider
final Cipher cipher = Cipher.getInstance(S8Constant.ALGORITHM);
exponent = rsaPK.getPublicExponent().toString(16);
} catch (Exception e) {
e.printStackTrace();
}
return exponent;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy