Search in sources :

Example 6 with Certificate

use of org.nhind.config.Certificate in project nhin-d by DirectProject.

the class RESTSmtpAgentConfigFunctional_Test method addCertificatesToConfig.

protected void addCertificatesToConfig(String certFilename, String keyFileName, String email) throws Exception {
    byte[] dataToAdd = null;
    if (keyFileName == null) {
        // just load the cert
        dataToAdd = loadCertificateData(certFilename);
    } else {
        dataToAdd = loadPkcs12FromCertAndKey(certFilename, keyFileName);
    }
    Certificate cert = new Certificate();
    cert.setData(dataToAdd);
    cert.setOwner(email);
    proxy.addCertificates(new Certificate[] { cert });
}
Also used : X509Certificate(java.security.cert.X509Certificate) Certificate(org.nhind.config.Certificate)

Aggregations

Certificate (org.nhind.config.Certificate)6 X509Certificate (java.security.cert.X509Certificate)4 Anchor (org.nhind.config.Anchor)2 ConfigurationServiceProxy (org.nhind.config.ConfigurationServiceProxy)2 Domain (org.nhind.config.Domain)2 File (java.io.File)1 URL (java.net.URL)1 RSAKey (java.security.interfaces.RSAKey)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Vector (java.util.Vector)1 MessagingException (javax.mail.MessagingException)1 MailetConfig (org.apache.mailet.MailetConfig)1 Setting (org.nhind.config.Setting)1 CertificateConversionException (org.nhindirect.config.model.exceptions.CertificateConversionException)1 CertUtils (org.nhindirect.config.model.utils.CertUtils)1 ConfigServiceURL (org.nhindirect.dns.annotation.ConfigServiceURL)1 BaseTestPlan (org.nhindirect.gateway.testutils.BaseTestPlan)1 CERTRecord (org.xbill.DNS.CERTRecord)1 RRset (org.xbill.DNS.RRset)1