private void checkPrivateKey(final RSAPrivateCrtKeySpec spec) { final List<String> missing = new ArrayList<>(); if (spec.getPrivateExponent() == null) missing.add("d"); if (spec.getPrimeP() == null) missing.add("p"); if (spec.getPrimeQ() == null) missing.add("q"); if (spec.getPrimeExponentP() == null) missing.add("dp"); if (spec.getPrimeExponentQ() == null) missing.add("dq"); if (spec.getCrtCoefficient() == null) missing.add("qi"); /** * We want them to supply either all or none of the private key data */ if (missing.size() == 6) return; // they've supplied none - good if (missing.size() == 0) return; // they've supplied all - good /** * They supplied just some. This doesn't work and isn't likely what they want */ throw new InvalidJwkKeySpecException("rsa", missing); }
private static OpenSSLKey init(RSAPrivateCrtKeySpec rsaKeySpec) throws InvalidKeySpecException { BigInteger modulus = rsaKeySpec.getModulus(); BigInteger privateExponent = rsaKeySpec.getPrivateExponent();
private static OpenSSLKey init(RSAPrivateCrtKeySpec rsaKeySpec) throws InvalidKeySpecException { BigInteger modulus = rsaKeySpec.getModulus(); BigInteger privateExponent = rsaKeySpec.getPrivateExponent();
private static OpenSSLKey init(RSAPrivateCrtKeySpec rsaKeySpec) throws InvalidKeySpecException { BigInteger modulus = rsaKeySpec.getModulus(); BigInteger privateExponent = rsaKeySpec.getPrivateExponent();
private static OpenSSLKey init(RSAPrivateCrtKeySpec rsaKeySpec) throws InvalidKeySpecException { BigInteger modulus = rsaKeySpec.getModulus(); BigInteger privateExponent = rsaKeySpec.getPrivateExponent();
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * 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(); }