当前位置: 首页>>代码示例>>Java>>正文


Java RSAPrivateCrtKeySpec.getCrtCoefficient方法代码示例

本文整理汇总了Java中java.security.spec.RSAPrivateCrtKeySpec.getCrtCoefficient方法的典型用法代码示例。如果您正苦于以下问题:Java RSAPrivateCrtKeySpec.getCrtCoefficient方法的具体用法?Java RSAPrivateCrtKeySpec.getCrtCoefficient怎么用?Java RSAPrivateCrtKeySpec.getCrtCoefficient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.security.spec.RSAPrivateCrtKeySpec的用法示例。


在下文中一共展示了RSAPrivateCrtKeySpec.getCrtCoefficient方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: JCERSAPrivateCrtKey

import java.security.spec.RSAPrivateCrtKeySpec; //导入方法依赖的package包/类
/**
 * construct a private key from an RSAPrivateCrtKeySpec
 *
 * @param spec the spec to be used in construction.
 */
JCERSAPrivateCrtKey(
    RSAPrivateCrtKeySpec spec)
{
    this.modulus = spec.getModulus();
    this.publicExponent = spec.getPublicExponent();
    this.privateExponent = spec.getPrivateExponent();
    this.primeP = spec.getPrimeP();
    this.primeQ = spec.getPrimeQ();
    this.primeExponentP = spec.getPrimeExponentP();
    this.primeExponentQ = spec.getPrimeExponentQ();
    this.crtCoefficient = spec.getCrtCoefficient();
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:JCERSAPrivateCrtKey.java

示例2: BCRSAPrivateCrtKey

import java.security.spec.RSAPrivateCrtKeySpec; //导入方法依赖的package包/类
/**
 * construct a private key from an RSAPrivateCrtKeySpec
 *
 * @param spec the spec to be used in construction.
 */
BCRSAPrivateCrtKey(
    RSAPrivateCrtKeySpec spec)
{
    this.modulus = spec.getModulus();
    this.publicExponent = spec.getPublicExponent();
    this.privateExponent = spec.getPrivateExponent();
    this.primeP = spec.getPrimeP();
    this.primeQ = spec.getPrimeQ();
    this.primeExponentP = spec.getPrimeExponentP();
    this.primeExponentQ = spec.getPrimeExponentQ();
    this.crtCoefficient = spec.getCrtCoefficient();
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:BCRSAPrivateCrtKey.java

示例3: TempJCERSAPrivateCrtKey

import java.security.spec.RSAPrivateCrtKeySpec; //导入方法依赖的package包/类
/**
 * construct a private key from an RSAPrivateCrtKeySpec
 *
 * @param spec the spec to be used in construction.
 */
TempJCERSAPrivateCrtKey(
    RSAPrivateCrtKeySpec spec)
{
    this.modulus = spec.getModulus();
    this.publicExponent = spec.getPublicExponent();
    this.privateExponent = spec.getPrivateExponent();
    this.primeP = spec.getPrimeP();
    this.primeQ = spec.getPrimeQ();
    this.primeExponentP = spec.getPrimeExponentP();
    this.primeExponentQ = spec.getPrimeExponentQ();
    this.crtCoefficient = spec.getCrtCoefficient();
}
 
开发者ID:B4dT0bi,项目名称:silvertunnel-ng,代码行数:18,代码来源:TempJCERSAPrivateCrtKey.java

示例4: init

import java.security.spec.RSAPrivateCrtKeySpec; //导入方法依赖的package包/类
private static OpenSSLKey init(RSAPrivateCrtKeySpec rsaKeySpec) throws InvalidKeySpecException {
    BigInteger modulus = rsaKeySpec.getModulus();
    BigInteger privateExponent = rsaKeySpec.getPrivateExponent();

    if (modulus == null) {
        throw new InvalidKeySpecException("modulus == null");
    } else if (privateExponent == null) {
        throw new InvalidKeySpecException("privateExponent == null");
    }

    try {
        /*
         * OpenSSL uses the public modulus to do RSA blinding. If
         * the public modulus is not available, the call to
         * EVP_PKEY_new_RSA will turn off blinding for this key
         * instance.
         */
        final BigInteger publicExponent = rsaKeySpec.getPublicExponent();
        final BigInteger primeP = rsaKeySpec.getPrimeP();
        final BigInteger primeQ = rsaKeySpec.getPrimeQ();
        final BigInteger primeExponentP = rsaKeySpec.getPrimeExponentP();
        final BigInteger primeExponentQ = rsaKeySpec.getPrimeExponentQ();
        final BigInteger crtCoefficient = rsaKeySpec.getCrtCoefficient();

        return new OpenSSLKey(NativeCrypto.EVP_PKEY_new_RSA(
                modulus.toByteArray(),
                publicExponent == null ? null : publicExponent.toByteArray(),
                privateExponent.toByteArray(),
                primeP == null ? null : primeP.toByteArray(),
                primeQ == null ? null : primeQ.toByteArray(),
                primeExponentP == null ? null : primeExponentP.toByteArray(),
                primeExponentQ == null ? null : primeExponentQ.toByteArray(),
                crtCoefficient == null ? null : crtCoefficient.toByteArray()));
    } catch (Exception e) {
        throw new InvalidKeySpecException(e);
    }
}
 
开发者ID:google,项目名称:conscrypt,代码行数:38,代码来源:OpenSSLRSAPrivateCrtKey.java

示例5: decodeRSAPrivateKey

import java.security.spec.RSAPrivateCrtKeySpec; //导入方法依赖的package包/类
/**
 * @param spec an instance of {@link RSAPrivateCrtKeySpec} to decode.
 * @return an instance of {@link GnuRSAPrivateKey} constructed from the
 *         information in the designated key-specification.
 */
private PrivateKey decodeRSAPrivateKey(RSAPrivateCrtKeySpec spec)
{
  BigInteger n = spec.getModulus();
  BigInteger e = spec.getPublicExponent();
  BigInteger d = spec.getPrivateExponent();
  BigInteger p = spec.getPrimeP();
  BigInteger q = spec.getPrimeQ();
  BigInteger dP = spec.getPrimeExponentP();
  BigInteger dQ = spec.getPrimeExponentQ();
  BigInteger qInv = spec.getCrtCoefficient();
  return new GnuRSAPrivateKey(Registry.PKCS8_ENCODING_ID,
                              n, e, d, p, q, dP, dQ, qInv);
}
 
开发者ID:vilie,项目名称:javify,代码行数:19,代码来源:EncodedKeyFactory.java


注:本文中的java.security.spec.RSAPrivateCrtKeySpec.getCrtCoefficient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。