public byte[] getEncoded() throws CertificateEncodingException { try { return cert.getEncoded(); } catch (java.security.cert.CertificateEncodingException e) { throw new CertificateEncodingException(e.getMessage()); } }
private void writeCertList(BufferedSink sink, List<Certificate> certificates) throws IOException { try { sink.writeDecimalLong(certificates.size()) .writeByte('\n'); for (int i = 0, size = certificates.size(); i < size; i++) { byte[] bytes = certificates.get(i).getEncoded(); String line = ByteString.of(bytes).base64(); sink.writeUtf8(line) .writeByte('\n'); } } catch (CertificateEncodingException e) { throw new IOException(e.getMessage()); } }
private void writeCertList(BufferedSink sink, List<Certificate> certificates) throws IOException { try { sink.writeDecimalLong(certificates.size()) .writeByte('\n'); for (int i = 0, size = certificates.size(); i < size; i++) { byte[] bytes = certificates.get(i).getEncoded(); String line = ByteString.of(bytes).base64(); sink.writeUtf8(line) .writeByte('\n'); } } catch (CertificateEncodingException e) { throw new IOException(e.getMessage()); } }
private void writeCertList(BufferedSink sink, List<Certificate> certificates) throws IOException { try { sink.writeDecimalLong(certificates.size()) .writeByte('\n'); for (int i = 0, size = certificates.size(); i < size; i++) { byte[] bytes = certificates.get(i).getEncoded(); String line = ByteString.of(bytes).base64(); sink.writeUtf8(line) .writeByte('\n'); } } catch (CertificateEncodingException e) { throw new IOException(e.getMessage()); } }
private void writeCertList(BufferedSink sink, List<Certificate> certificates) throws IOException { try { sink.writeDecimalLong(certificates.size()) .writeByte('\n'); for (int i = 0, size = certificates.size(); i < size; i++) { byte[] bytes = certificates.get(i).getEncoded(); String line = ByteString.of(bytes).base64(); sink.writeUtf8(line) .writeByte('\n'); } } catch (CertificateEncodingException e) { throw new IOException(e.getMessage()); } }
} catch (CertificateEncodingException e) { throw new RuntimeException("certificate encoding error: " + e.getMessage(), e);
encapsulatedPKIDataType.setByteArrayValue(certificate.getEncoded()); } catch (CertificateEncodingException e) { throw new RuntimeException("certificate encoding error: " + e.getMessage(), e);
public byte[] getEncoded() throws CertificateEncodingException { try { return cert.getEncoded(); } catch (java.security.cert.CertificateEncodingException e) { throw new CertificateEncodingException(e.getMessage()); } }
public synchronized JsonElement serialize( final X509Certificate cert, final Type type, final JsonSerializationContext jsonSerializationContext ) { try { return new JsonPrimitive( StringUtil.base64Encode( cert.getEncoded() ) ); } catch ( CertificateEncodingException e ) { throw new IllegalStateException( "unable to json-encode certificate: " + e.getMessage() ); } }
public byte[] getEncoded() throws CertificateEncodingException { try { return cert.getEncoded(); } catch (java.security.cert.CertificateEncodingException e) { throw new CertificateEncodingException(e.getMessage()); } }
public byte[] getEncoded() throws CertificateEncodingException { try { return cert.getEncoded(); } catch (java.security.cert.CertificateEncodingException e) { throw new CertificateEncodingException(e.getMessage()); } }
public byte[] getEncoded() throws CertificateEncodingException { try { return cert.getEncoded(); } catch (java.security.cert.CertificateEncodingException e) { throw new CertificateEncodingException(e.getMessage()); } }
public byte[] getEncoded() throws IOException { try { // DER encoding enforced by provider - as defined by JCA for X.509 certificates. return certificate.getEncoded(); } catch (CertificateEncodingException e) { throw new TlsCryptoException("unable to encode certificate: " + e.getMessage(), e); } }
private String getFingerprint(X509Certificate certificate) { byte[] encodedCertificate; try { encodedCertificate = certificate.getEncoded(); } catch (CertificateEncodingException e) { throw new IllegalArgumentException("certificate encoding error: " + e.getMessage(), e); } String fingerprint = DigestUtils.sha1Hex(encodedCertificate); return fingerprint; } }
public byte[] getEncoded() throws CertificateEncodingException { try { return cert.getEncoded(); } catch (java.security.cert.CertificateEncodingException e) { throw new CertificateEncodingException(e.getMessage()); } }
public byte[] getEncodedCertificate() { X509Certificate certificate = getCertificate(); try { return certificate.getEncoded(); } catch (CertificateEncodingException e) { throw new RuntimeException("certificate encoding error: " + e.getMessage(), e); } } }
private static String certHash(final X509Certificate cert, String digest) { try { MessageDigest md = MessageDigest.getInstance(digest); md.update(cert.getEncoded()); return hexString(md.digest()); } catch (java.security.cert.CertificateEncodingException e) { return e.getMessage(); } catch (java.security.NoSuchAlgorithmException e) { return e.getMessage(); } }
public CollectionCertificateValidator(X509Certificate cert) { ScepUtil.requireNonNull("cert", cert); certHashes = new HashSet<String>(2); String hash; try { hash = ScepHashAlgo.SHA256.hexDigest(cert.getEncoded()); } catch (CertificateEncodingException ex) { throw new IllegalArgumentException("could not encode certificate: " + ex.getMessage(), ex); } certHashes.add(hash); }
private static Certificate convertCert(X509Certificate certificate) throws IOException { try { return Certificate.getInstance(certificate.getEncoded()); } catch (CertificateEncodingException e) { throw new PKCSIOException("cannot encode certificate: " + e.getMessage(), e); } }
private static Certificate convertCert(X509Certificate certificate) throws IOException { try { return Certificate.getInstance(certificate.getEncoded()); } catch (CertificateEncodingException e) { throw new PKCSIOException("cannot encode certificate: " + e.getMessage(), e); } }