private X509Certificate unwrap() { X509Certificate wrapped = this.wrapped; if (wrapped == null) { try { wrapped = this.wrapped = X509Certificate.getInstance(bytes); } catch (CertificateException e) { throw new IllegalStateException(e); } } return wrapped; } }
@Override public void verify(PublicKey key) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException { unwrap().verify(key); }
@Override public Principal getSubjectDN() { return unwrap().getSubjectDN(); }
@Override public BigInteger getSerialNumber() { return unwrap().getSerialNumber(); }
@Override public Principal getIssuerDN() { return unwrap().getIssuerDN(); }
@Override public void checkValidity(Date date) throws CertificateExpiredException, CertificateNotYetValidException { unwrap().checkValidity(date); }
@Override public PublicKey getPublicKey() { return unwrap().getPublicKey(); }
@Override public Date getNotBefore() { return unwrap().getNotBefore(); }
@Override public Date getNotAfter() { return unwrap().getNotAfter(); }
@Override public String toString() { return unwrap().toString(); }
@Override public String getSigAlgOID() { return unwrap().getSigAlgOID(); }
@Override public String getSigAlgName() { return unwrap().getSigAlgName(); }
@Override public byte[] getSigAlgParams() { return unwrap().getSigAlgParams(); }
@Override public int getVersion() { return unwrap().getVersion(); }
private X509Certificate unwrap() { X509Certificate wrapped = this.wrapped; if (wrapped == null) { try { wrapped = this.wrapped = X509Certificate.getInstance(bytes); } catch (CertificateException e) { throw new IllegalStateException(e); } } return wrapped; } }
public static String cnOf(X509Certificate cert) throws Exception { String dn = cert.getSubjectDN().getName(); List<String> names = KeyStoreHelper.getX509CertificateCommonNames(dn); return names.isEmpty() ? null : names.get(0); }
@Override public void verify(PublicKey key, String sigProvider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException { unwrap().verify(key, sigProvider); }
@Override public void checkValidity() throws CertificateExpiredException, CertificateNotYetValidException { unwrap().checkValidity(); }
@Override public void verify(PublicKey key, String sigProvider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException { unwrap().verify(key, sigProvider); }
@Override public void verify(PublicKey key) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException { unwrap().verify(key); }