Search in sources :

Example 11 with BCECPublicKey

use of org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey in project oxAuth by GluuFederation.

the class Certificate method getEcdsaPublicKey.

public ECDSAPublicKey getEcdsaPublicKey() {
    ECDSAPublicKey ecdsaPublicKey = null;
    if (x509Certificate != null && x509Certificate.getPublicKey() instanceof BCECPublicKey) {
        BCECPublicKey publicKey = (BCECPublicKey) x509Certificate.getPublicKey();
        ecdsaPublicKey = new ECDSAPublicKey(signatureAlgorithm, publicKey.getQ().getXCoord().toBigInteger(), publicKey.getQ().getYCoord().toBigInteger());
    }
    return ecdsaPublicKey;
}
Also used : BCECPublicKey(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey) ECDSAPublicKey(org.gluu.oxauth.model.crypto.signature.ECDSAPublicKey)

Aggregations

BCECPublicKey (org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey)11 BigInteger (java.math.BigInteger)3 SubjectPublicKeyInfo (org.bouncycastle.asn1.x509.SubjectPublicKeyInfo)3 ECParameterSpec (org.bouncycastle.jce.spec.ECParameterSpec)3 InvalidKeyException (java.security.InvalidKeyException)2 PublicKey (java.security.PublicKey)2 InvalidKeySpecException (java.security.spec.InvalidKeySpecException)2 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)2 X9ECParameters (org.bouncycastle.asn1.x9.X9ECParameters)2 ECDomainParameters (org.bouncycastle.crypto.params.ECDomainParameters)2 ECPublicKeyParameters (org.bouncycastle.crypto.params.ECPublicKeyParameters)2 BCECPrivateKey (org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey)2 BCRSAPublicKey (org.bouncycastle.jcajce.provider.asymmetric.rsa.BCRSAPublicKey)2 ECPublicKeySpec (org.bouncycastle.jce.spec.ECPublicKeySpec)2 PEMException (org.bouncycastle.openssl.PEMException)2 PEMParser (org.bouncycastle.openssl.PEMParser)2 JcaPEMKeyConverter (org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter)2 ECDSAPublicKey (org.gluu.oxauth.model.crypto.signature.ECDSAPublicKey)2 ECDSAPublicKey (org.xdi.oxauth.model.crypto.signature.ECDSAPublicKey)2 ByteString (com.google.protobuf.ByteString)1