Search in sources :

Example 86 with X500Name

use of org.bouncycastle.asn1.x500.X500Name in project ddf by codice.

the class PkiToolsTest method nameIsNotEmpty.

@Test
public void nameIsNotEmpty() throws CertificateEncodingException {
    String host = "host.domain.tld";
    X500Name name = PkiTools.makeDistinguishedName(host);
    assertThat(name.toString(), equalTo("cn=" + host));
}
Also used : X500Name(org.bouncycastle.asn1.x500.X500Name) Test(org.junit.Test)

Aggregations

X500Name (org.bouncycastle.asn1.x500.X500Name)54 X509Certificate (java.security.cert.X509Certificate)39 X500Name (sun.security.x509.X500Name)30 IOException (java.io.IOException)23 Date (java.util.Date)22 JcaX509CertificateConverter (org.bouncycastle.cert.jcajce.JcaX509CertificateConverter)20 X509CertificateHolder (org.bouncycastle.cert.X509CertificateHolder)19 BigInteger (java.math.BigInteger)18 SecureRandom (java.security.SecureRandom)16 X509v3CertificateBuilder (org.bouncycastle.cert.X509v3CertificateBuilder)16 JcaX509v3CertificateBuilder (org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder)15 JcaContentSignerBuilder (org.bouncycastle.operator.jcajce.JcaContentSignerBuilder)15 KeyPair (java.security.KeyPair)12 PrivateKey (java.security.PrivateKey)12 CertificateEncodingException (java.security.cert.CertificateEncodingException)12 RDN (org.bouncycastle.asn1.x500.RDN)12 ContentSigner (org.bouncycastle.operator.ContentSigner)12 KeyStore (java.security.KeyStore)11 ArrayList (java.util.ArrayList)10 GeneralName (org.bouncycastle.asn1.x509.GeneralName)10