static TlsSignerCredentials loadSignerCredentials(TlsContext context, String[] certResources, String keyResource, SignatureAndHashAlgorithm signatureAndHashAlgorithm) throws IOException { Certificate certificate = loadCertificateChain(certResources); AsymmetricKeyParameter privateKey = loadPrivateKeyResource(keyResource); return new DefaultTlsSignerCredentials(context, certificate, privateKey, signatureAndHashAlgorithm); }
static TlsSignerCredentials loadSignerCredentials(TlsServerContext context, String[] certResources, String keyResource, SignatureAndHashAlgorithm signatureAndHashAlgorithm) throws IOException { Certificate certificate = loadCertificateChain(certResources); AsymmetricKeyParameter privateKey = loadPrivateKeyResource(keyResource); return new DefaultTlsSignerCredentials(context, certificate, privateKey, signatureAndHashAlgorithm); }
static TlsSignerCredentials loadSignerCredentials(TlsServerContext context, String[] certResources, String keyResource, SignatureAndHashAlgorithm signatureAndHashAlgorithm) throws IOException { Certificate certificate = loadCertificateChain(certResources); AsymmetricKeyParameter privateKey = loadPrivateKeyResource(keyResource); return new DefaultTlsSignerCredentials(context, certificate, privateKey, signatureAndHashAlgorithm); }
static TlsSignerCredentials loadSignerCredentials(TlsContext context, String[] certResources, String keyResource) throws IOException { Certificate certificate = loadCertificateChain(certResources); AsymmetricKeyParameter privateKey = loadPrivateKeyResource(keyResource); return new DefaultTlsSignerCredentials(context, certificate, privateKey); }
static TlsSignerCredentials loadSignerCredentials(TlsContext context, String[] certResources, String keyResource) throws IOException { Certificate certificate = loadCertificateChain(certResources); AsymmetricKeyParameter privateKey = loadPrivateKeyResource(keyResource); return new DefaultTlsSignerCredentials(context, certificate, privateKey); }
/** * {@inheritDoc} */ @Override public TlsCredentials getClientCredentials( CertificateRequest certificateRequest) throws IOException { if (clientCredentials == null) { CertificateInfo certificateInfo = getDtlsControl().getCertificateInfo(); // FIXME The signature and hash algorithms should be retrieved // from the certificate. clientCredentials = new DefaultTlsSignerCredentials( context, certificateInfo.getCertificate(), certificateInfo.getKeyPair().getPrivate(), new SignatureAndHashAlgorithm( HashAlgorithm.sha1, SignatureAlgorithm.rsa)); } return clientCredentials; }
/** * {@inheritDoc} * * Depending on the <tt>selectedCipherSuite</tt>, <tt>DefaultTlsServer</tt> * will require either <tt>rsaEncryptionCredentials</tt> or * <tt>rsaSignerCredentials</tt> neither of which is implemented by * <tt>DefaultTlsServer</tt>. */ @Override protected TlsSignerCredentials getRSASignerCredentials() throws IOException { if (rsaSignerCredentials == null) { CertificateInfo certificateInfo = getDtlsControl().getCertificateInfo(); // FIXME The signature and hash algorithms should be retrieved from // the certificate. rsaSignerCredentials = new DefaultTlsSignerCredentials( context, certificateInfo.getCertificate(), certificateInfo.getKeyPair().getPrivate(), new SignatureAndHashAlgorithm( HashAlgorithm.sha1, SignatureAlgorithm.rsa)); } return rsaSignerCredentials; }