@Override public void delete() { certificate.delete(); } }
@Override protected SimpleTrustManagerFactorySpi initialValue() { return new SimpleTrustManagerFactorySpi(); } };
/** * Creates a new instance. * * @param fqdn a fully qualified domain name * @param notBefore Certificate is not valid before this time * @param notAfter Certificate is not valid after this time */ public SelfSignedCertificate(String fqdn, Date notBefore, Date notAfter) throws CertificateException { // Bypass entropy collection by using insecure random generator. // We just want to generate it without any delay because it's for testing purposes only. this(fqdn, ThreadLocalInsecureRandom.current(), 1024, notBefore, notAfter); }
public SelfSignedCertificateImpl() { try { certificate = new io.netty.handler.ssl.util.SelfSignedCertificate(); } catch (CertificateException e) { throw new VertxException(e); } }
@Override public String certificatePath() { return certificate.certificate().getAbsolutePath(); }
@Override public String privateKeyPath() { return certificate.privateKey().getAbsolutePath(); }
@Override public byte[] generateSeed(int numBytes) { byte[] seed = new byte[numBytes]; random().nextBytes(seed); return seed; }
/** * Deletes the generated X.509 certificate file and RSA private key file. */ public void delete() { safeDelete(certificate); safeDelete(privateKey); }
/** * Creates a new instance. * * @param fingerprints a list of SHA1 fingerprints in hexadecimal form */ public FingerprintTrustManagerFactory(Iterable<String> fingerprints) { this(toFingerprintArray(fingerprints)); }
@Override public void checkClientTrusted(X509Certificate[] chain, String s) throws CertificateException { checkTrusted("client", chain); }
@Override protected void engineInit(KeyStore keyStore) throws KeyStoreException { try { parent.engineInit(keyStore); } catch (KeyStoreException e) { throw e; } catch (Exception e) { throw new KeyStoreException(e); } }
public SelfSignedCertificateImpl(String fqdn) { try { certificate = new io.netty.handler.ssl.util.SelfSignedCertificate(fqdn); } catch (CertificateException e) { throw new VertxException(e); } }
@Override public int nextInt(int n) { return random().nextInt(n); }
/** * Deletes the generated X.509 certificate file and RSA private key file. */ public void delete() { safeDelete(certificate); safeDelete(privateKey); }
/** * Creates a new instance. * * @param fingerprints a list of SHA1 fingerprints in hexadecimal form */ public FingerprintTrustManagerFactory(String... fingerprints) { this(toFingerprintArray(Arrays.asList(fingerprints))); }
@Override public void checkServerTrusted(X509Certificate[] chain, String s) throws CertificateException { checkTrusted("server", chain); }
@Override protected void engineInit( ManagerFactoryParameters managerFactoryParameters) throws InvalidAlgorithmParameterException { try { parent.engineInit(managerFactoryParameters); } catch (InvalidAlgorithmParameterException e) { throw e; } catch (Exception e) { throw new InvalidAlgorithmParameterException(e); } }
@Override public boolean nextBoolean() { return random().nextBoolean(); }
@Override public double nextGaussian() { return random().nextGaussian(); }
@Override public int nextInt() { return random().nextInt(); }