use of org.bouncycastle.jcajce.provider.asymmetric.rsa.BCRSAPublicKey in project oxAuth by GluuFederation.
the class Certificate method getRsaPublicKey.
public RSAPublicKey getRsaPublicKey() {
RSAPublicKey rsaPublicKey = null;
if (x509Certificate != null && x509Certificate.getPublicKey() instanceof BCRSAPublicKey) {
BCRSAPublicKey publicKey = (BCRSAPublicKey) x509Certificate.getPublicKey();
rsaPublicKey = new RSAPublicKey(publicKey.getModulus(), publicKey.getPublicExponent());
}
return rsaPublicKey;
}
use of org.bouncycastle.jcajce.provider.asymmetric.rsa.BCRSAPublicKey in project oxAuth by GluuFederation.
the class Certificate method getPublicKey.
public PublicKey getPublicKey() {
PublicKey publicKey = null;
if (x509Certificate != null && x509Certificate.getPublicKey() instanceof BCRSAPublicKey) {
BCRSAPublicKey jcersaPublicKey = (BCRSAPublicKey) x509Certificate.getPublicKey();
publicKey = new RSAPublicKey(jcersaPublicKey.getModulus(), jcersaPublicKey.getPublicExponent());
} else if (x509Certificate != null && x509Certificate.getPublicKey() instanceof BCECPublicKey) {
BCECPublicKey jceecPublicKey = (BCECPublicKey) x509Certificate.getPublicKey();
publicKey = new ECDSAPublicKey(signatureAlgorithm, jceecPublicKey.getQ().getX().toBigInteger(), jceecPublicKey.getQ().getY().toBigInteger());
}
return publicKey;
}
Aggregations