@Override public PublicKey getPublicKey() { PublicKey result = publicKey; if (result == null) { publicKey = result = tbsCert.getSubjectPublicKeyInfo().getPublicKey(); } return result; }
/** * Sets the criterion for the subject public key. * * @param key * the subject public key in ASN.1 DER encoded format or {@code null} to * not check the key. * @throws IOException * if decoding the the public key fails. */ public void setSubjectPublicKey(byte[] key) throws IOException { if (key == null) { subjectPublicKey = null; subjectPublicKeyImpl = null; return; } subjectPublicKey = new byte[key.length]; System.arraycopy(key, 0, subjectPublicKey, 0, key.length); subjectPublicKeyImpl = ((SubjectPublicKeyInfo) SubjectPublicKeyInfo.ASN1.decode(key)) .getPublicKey(); }
@Override public String toString() { StringBuilder res = new StringBuilder(); res.append("-- CertificationRequestInfo:"); res.append("\n version: "); res.append(version); res.append("\n subject: "); res.append(subject.getName(X500Principal.CANONICAL)); res.append("\n subjectPublicKeyInfo: "); res.append("\n\t algorithm: "); res.append(subjectPublicKeyInfo.getAlgorithmIdentifier().getAlgorithm()); res.append("\n\t public key: ").append(subjectPublicKeyInfo.getPublicKey()); res.append("\n attributes: "); if (attributes != null) { res.append(attributes.toString()); } else { res.append("none"); } res.append("\n-- CertificationRequestInfo End\n"); return res.toString(); }
sb.append("\n Signature Algorithm: "); signature.dumpValue(sb); sb.append("\n Key: ").append(subjectPublicKeyInfo.getPublicKey().toString()); sb.append("\n Validity: [From: ").append(validity.getNotBefore()); sb.append("\n To: ").append(validity.getNotAfter()).append(']');
@Override public PublicKey getPublicKey() { PublicKey result = publicKey; if (result == null) { publicKey = result = tbsCert.getSubjectPublicKeyInfo().getPublicKey(); } return result; }
@Override public PublicKey getPublicKey() { PublicKey result = publicKey; if (result == null) { publicKey = result = tbsCert.getSubjectPublicKeyInfo().getPublicKey(); } return result; }
@Override public PublicKey getPublicKey() { PublicKey result = publicKey; if (result == null) { publicKey = result = tbsCert.getSubjectPublicKeyInfo().getPublicKey(); } return result; }
@Override public PublicKey getPublicKey() { PublicKey result = publicKey; if (result == null) { publicKey = result = tbsCert.getSubjectPublicKeyInfo().getPublicKey(); } return result; }
@Override public PublicKey getPublicKey() { PublicKey result = publicKey; if (result == null) { publicKey = result = tbsCert.getSubjectPublicKeyInfo().getPublicKey(); } return result; }
@Override public PublicKey getPublicKey() { PublicKey result = publicKey; if (result == null) { publicKey = result = tbsCert.getSubjectPublicKeyInfo().getPublicKey(); } return result; }
/** * Sets the criterion for the subject public key. * * @param key * the subject public key in ASN.1 DER encoded format or {@code null} to * not check the key. * @throws IOException * if decoding the the public key fails. */ public void setSubjectPublicKey(byte[] key) throws IOException { if (key == null) { subjectPublicKey = null; subjectPublicKeyImpl = null; return; } subjectPublicKey = new byte[key.length]; System.arraycopy(key, 0, subjectPublicKey, 0, key.length); subjectPublicKeyImpl = ((SubjectPublicKeyInfo) SubjectPublicKeyInfo.ASN1.decode(key)) .getPublicKey(); }
/** * Sets the criterion for the subject public key. * * @param key * the subject public key in ASN.1 DER encoded format or {@code null} to * not check the key. * @throws IOException * if decoding the the public key fails. */ public void setSubjectPublicKey(byte[] key) throws IOException { if (key == null) { subjectPublicKey = null; subjectPublicKeyImpl = null; return; } subjectPublicKey = new byte[key.length]; System.arraycopy(key, 0, subjectPublicKey, 0, key.length); subjectPublicKeyImpl = ((SubjectPublicKeyInfo) SubjectPublicKeyInfo.ASN1.decode(key)) .getPublicKey(); }
/** * Sets the criterion for the subject public key. * * @param key * the subject public key in ASN.1 DER encoded format or {@code null} to * not check the key. * @throws IOException * if decoding the the public key fails. */ public void setSubjectPublicKey(byte[] key) throws IOException { if (key == null) { subjectPublicKey = null; subjectPublicKeyImpl = null; return; } subjectPublicKey = new byte[key.length]; System.arraycopy(key, 0, subjectPublicKey, 0, key.length); subjectPublicKeyImpl = ((SubjectPublicKeyInfo) SubjectPublicKeyInfo.ASN1.decode(key)) .getPublicKey(); }
/** * Sets the criterion for the subject public key. * * @param key * the subject public key in ASN.1 DER encoded format or {@code null} to * not check the key. * @throws IOException * if decoding the the public key fails. */ public void setSubjectPublicKey(byte[] key) throws IOException { if (key == null) { subjectPublicKey = null; subjectPublicKeyImpl = null; return; } subjectPublicKey = new byte[key.length]; System.arraycopy(key, 0, subjectPublicKey, 0, key.length); subjectPublicKeyImpl = ((SubjectPublicKeyInfo) SubjectPublicKeyInfo.ASN1.decode(key)) .getPublicKey(); }
public void processServerCertificate(Certificate serverCertificate) throws IOException { SubjectPublicKeyInfo subPubKeyInfo = serverCertificate.certs[0].getTBSCertificate().getSubjectPublicKeyInfo(); RSAPublicKey pubKey = RSAPublicKey.getInstance(subPubKeyInfo.getPublicKey()); rsaServerPublicKey = new RSAKeyParameters(false,pubKey.getModulus(),pubKey.getPublicExponent()); }
@Override public String toString() { StringBuilder res = new StringBuilder(); res.append("-- CertificationRequestInfo:"); res.append("\n version: "); res.append(version); res.append("\n subject: "); res.append(subject.getName(X500Principal.CANONICAL)); res.append("\n subjectPublicKeyInfo: "); res.append("\n\t algorithm: "); res.append(subjectPublicKeyInfo.getAlgorithmIdentifier().getAlgorithm()); res.append("\n\t public key: ").append(subjectPublicKeyInfo.getPublicKey()); res.append("\n attributes: "); if (attributes != null) { res.append(attributes.toString()); } else { res.append("none"); } res.append("\n-- CertificationRequestInfo End\n"); return res.toString(); }
@Override public String toString() { StringBuilder res = new StringBuilder(); res.append("-- CertificationRequestInfo:"); res.append("\n version: "); res.append(version); res.append("\n subject: "); res.append(subject.getName(X500Principal.CANONICAL)); res.append("\n subjectPublicKeyInfo: "); res.append("\n\t algorithm: "); res.append(subjectPublicKeyInfo.getAlgorithmIdentifier().getAlgorithm()); res.append("\n\t public key: ").append(subjectPublicKeyInfo.getPublicKey()); res.append("\n attributes: "); if (attributes != null) { res.append(attributes.toString()); } else { res.append("none"); } res.append("\n-- CertificationRequestInfo End\n"); return res.toString(); }
@Override public String toString() { StringBuilder res = new StringBuilder(); res.append("-- CertificationRequestInfo:"); res.append("\n version: "); res.append(version); res.append("\n subject: "); res.append(subject.getName(X500Principal.CANONICAL)); res.append("\n subjectPublicKeyInfo: "); res.append("\n\t algorithm: "); res.append(subjectPublicKeyInfo.getAlgorithmIdentifier().getAlgorithm()); res.append("\n\t public key: ").append(subjectPublicKeyInfo.getPublicKey()); res.append("\n attributes: "); if (attributes != null) { res.append(attributes.toString()); } else { res.append("none"); } res.append("\n-- CertificationRequestInfo End\n"); return res.toString(); }
@Override public String toString() { StringBuilder res = new StringBuilder(); res.append("-- CertificationRequestInfo:"); res.append("\n version: "); res.append(version); res.append("\n subject: "); res.append(subject.getName(X500Principal.CANONICAL)); res.append("\n subjectPublicKeyInfo: "); res.append("\n\t algorithm: "); res.append(subjectPublicKeyInfo.getAlgorithmIdentifier().getAlgorithm()); res.append("\n\t public key: ").append(subjectPublicKeyInfo.getPublicKey()); res.append("\n attributes: "); if (attributes != null) { res.append(attributes.toString()); } else { res.append("none"); } res.append("\n-- CertificationRequestInfo End\n"); return res.toString(); }
@Override public String toString() { StringBuilder res = new StringBuilder(); res.append("-- CertificationRequestInfo:"); res.append("\n version: "); res.append(version); res.append("\n subject: "); res.append(subject.getName(X500Principal.CANONICAL)); res.append("\n subjectPublicKeyInfo: "); res.append("\n\t algorithm: "); res.append(subjectPublicKeyInfo.getAlgorithmIdentifier().getAlgorithm()); res.append("\n\t public key: ").append(subjectPublicKeyInfo.getPublicKey()); res.append("\n attributes: "); if (attributes != null) { res.append(attributes.toString()); } else { res.append("none"); } res.append("\n-- CertificationRequestInfo End\n"); return res.toString(); }