Example usage for java.security.interfaces RSAPrivateCrtKey getPrimeQ

List of usage examples for java.security.interfaces RSAPrivateCrtKey getPrimeQ

Introduction

In this page you can find the example usage for java.security.interfaces RSAPrivateCrtKey getPrimeQ.

Prototype

public BigInteger getPrimeQ();

Source Link

Document

Returns the primeQ.

Usage

From source file:org.ebayopensource.fido.uaf.crypto.KeyCodec.java

static public RSAKeyParameters generatePrivateKeyParameter(RSAPrivateKey key) {
    if (key instanceof RSAPrivateCrtKey) {
        RSAPrivateCrtKey k = (RSAPrivateCrtKey) key;
        return new RSAPrivateCrtKeyParameters(k.getModulus(), k.getPublicExponent(), k.getPrivateExponent(),
                k.getPrimeP(), k.getPrimeQ(), k.getPrimeExponentP(), k.getPrimeExponentQ(),
                k.getCrtCoefficient());/*  www .  ja v a  2 s. c om*/
    } else {
        RSAPrivateKey k = key;
        return new RSAKeyParameters(true, k.getModulus(), k.getPrivateExponent());
    }
}