P11Identity identity = identities.get(objectId); sb.append("\t").append(objectId); if (identity.getPublicKey() != null) { sb.append(", algo=").append(identity.getPublicKey().getAlgorithm()); if (identity.getCertificate() != null) { String subject = X509Util.getRfc4519Name(
P11Identity identity = identities.get(objectId); sb.append("\t").append(objectId); if (identity.getPublicKey() != null) { sb.append(", algo=").append(identity.getPublicKey().getAlgorithm()); if (identity.getCertificate() != null) { String subject = X509Util.getRfc4519Name(
if (identity.getPublicKey() != null) { String algo = identity.getPublicKey().getAlgorithm(); sb.append("\t\tAlgorithm: ").append(algo).append("\n"); X509Certificate[] certs = identity.certificateChain();
public static P11RSAKeyParameter getInstance(P11CryptService p11CryptService, P11IdentityId identityId) throws InvalidKeyException { ParamUtil.requireNonNull("p11CryptService", p11CryptService); ParamUtil.requireNonNull("identityId", identityId); RSAPublicKey key; try { key = (RSAPublicKey) p11CryptService.getIdentity(identityId).getPublicKey(); } catch (P11TokenException ex) { throw new InvalidKeyException(ex.getMessage(), ex); } BigInteger modulus = key.getModulus(); BigInteger publicExponent = key.getPublicExponent(); return new P11RSAKeyParameter(p11CryptService, identityId, modulus, publicExponent); }
if (identity.getPublicKey() != null) { String algo = identity.getPublicKey().getAlgorithm(); sb.append("\t\tAlgorithm: ").append(algo).append("\n"); X509Certificate[] certs = identity.certificateChain();
public static P11RSAKeyParameter getInstance(P11CryptService p11CryptService, P11IdentityId identityId) throws InvalidKeyException { Args.notNull(p11CryptService, "p11CryptService"); Args.notNull(identityId, "identityId"); RSAPublicKey key; try { key = (RSAPublicKey) p11CryptService.getIdentity(identityId).getPublicKey(); } catch (P11TokenException ex) { throw new InvalidKeyException(ex.getMessage(), ex); } BigInteger modulus = key.getModulus(); BigInteger publicExponent = key.getPublicExponent(); return new P11RSAKeyParameter(p11CryptService, identityId, modulus, publicExponent); }
java.security.PublicKey pk = identity.getPublicKey(); java.security.PublicKey newPk = newCert.getPublicKey(); if (!pk.equals(newPk)) {
X509Certificate signerCertInP11 = identity.getCertificate(); PublicKey publicKeyInP11 = (signerCertInP11 != null) ? signerCertInP11.getPublicKey() : identity.getPublicKey();
X509Certificate signerCertInP11 = identity.getCertificate(); PublicKey publicKeyInP11 = (signerCertInP11 != null) ? signerCertInP11.getPublicKey() : identity.getPublicKey();
public P11PrivateKey(P11CryptService p11CryptService, P11IdentityId identityId) throws P11TokenException { this.p11CryptService = Args.notNull(p11CryptService, "p11CryptService"); this.identityId = Args.notNull(identityId, "identityId"); this.publicKey = p11CryptService.getIdentity(identityId).getPublicKey(); if (this.publicKey instanceof RSAPublicKey) { algorithm = "RSA"; keysize = ((RSAPublicKey) publicKey).getModulus().bitLength(); } else if (this.publicKey instanceof DSAPublicKey) { algorithm = "DSA"; keysize = ((DSAPublicKey) publicKey).getParams().getP().bitLength(); } else if (this.publicKey instanceof ECPublicKey) { algorithm = "EC"; keysize = ((ECPublicKey) publicKey).getParams().getCurve().getField().getFieldSize(); } else { throw new P11TokenException("unknown public key: " + publicKey); } }
public P11PrivateKey(P11CryptService p11CryptService, P11IdentityId identityId) throws P11TokenException { this.p11CryptService = ParamUtil.requireNonNull("identityId", p11CryptService); this.identityId = ParamUtil.requireNonNull("entityId", identityId); this.publicKey = p11CryptService.getIdentity(identityId).getPublicKey(); if (this.publicKey instanceof RSAPublicKey) { algorithm = "RSA"; keysize = ((RSAPublicKey) publicKey).getModulus().bitLength(); } else if (this.publicKey instanceof DSAPublicKey) { algorithm = "DSA"; keysize = ((DSAPublicKey) publicKey).getParams().getP().bitLength(); } else if (this.publicKey instanceof ECPublicKey) { algorithm = "EC"; keysize = ((ECPublicKey) publicKey).getParams().getCurve().getField().getFieldSize(); } else { throw new P11TokenException("unknown public key: " + publicKey); } }
RSAPublicKey rsaPubKey = (RSAPublicKey) cryptService.getIdentity(identityId).getPublicKey(); this.modulusBitLen = rsaPubKey.getModulus().bitLength();
java.security.PublicKey pk = identity.getPublicKey(); java.security.PublicKey newPk = newCert.getPublicKey(); if (!pk.equals(newPk)) {
RSAPublicKey rsaPubKey = (RSAPublicKey) cryptService.getIdentity(identityId).getPublicKey(); this.modulusBitLen = rsaPubKey.getModulus().bitLength();
signatureAlgId = AlgorithmUtil.getSigAlgId(null, conf); } else { PublicKey pubKey = slot.getIdentity(identityId.getKeyId()).getPublicKey(); signatureAlgId = AlgorithmUtil.getSigAlgId(pubKey, conf);
signatureAlgId = AlgorithmUtil.getSigAlgId(null, conf); } else { PublicKey pubKey = slot.getIdentity(identityId.getKeyId()).getPublicKey(); signatureAlgId = AlgorithmUtil.getSigAlgId(pubKey, conf);