Package org.bouncycastle.asn1.x500

Examples of org.bouncycastle.asn1.x500.AttributeTypeAndValue


    Calendar startDate = Calendar.getInstance();
    Calendar endDate = Calendar.getInstance();
    endDate.add(Calendar.YEAR, 100);

    BigInteger serialNumber = BigInteger.valueOf((startDate.getTimeInMillis()));
    X500Name issuer = new X500Name(IETFUtils.rDNsFromString(issuerDirString, RFC4519Style.INSTANCE));
    JcaX509v3CertificateBuilder certGen = new JcaX509v3CertificateBuilder(issuer, serialNumber, startDate.getTime(), endDate.getTime(), issuer, kp.getPublic());
    JcaX509ExtensionUtils extensionUtils = new JcaX509ExtensionUtils();
    certGen.addExtension(Extension.subjectKeyIdentifier, false, extensionUtils.createSubjectKeyIdentifier(kp.getPublic()));
    certGen.addExtension(Extension.basicConstraints, false, new BasicConstraints(isCertAuthority));
    certGen.addExtension(Extension.authorityKeyIdentifier, false, extensionUtils.createAuthorityKeyIdentifier(signerPublicKey));
View Full Code Here


    converter.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
    return converter.getCertificate(holder);
  }

  public static String getName(final X500Principal principal) {
    X500Name x500Name = new X500Name(principal.getName());
    return BouncyCastleProviderHelper.getName(x500Name);
  }
View Full Code Here

    X500Name x500Name = new X500Name(principal.getName());
    return BouncyCastleProviderHelper.getName(x500Name);
  }

  public static String getName(final X509Principal principal) {
    X500Name x500Name = new X500Name(principal.getName());
    return BouncyCastleProviderHelper.getName(x500Name);
  }
View Full Code Here

  }

  public static X500Principal toX500Principal(final String value) throws IOException {
    X500NameBuilder builder = new X500NameBuilder(BCStyle.INSTANCE);
    builder.addRDN(BCStyle.CN, value);
    X500Name name = builder.build();
    return BouncyCastleProviderHelper.toX500Principal(name);
  }
View Full Code Here

  }

  private X500Principal toX500Principal(final String value) throws IOException {
    X500NameBuilder builder = new X500NameBuilder(BCStyle.INSTANCE);
    builder.addRDN(BCStyle.CN, value);
    X500Name name = builder.build();
    return this.toX500Principal(name);
  }
View Full Code Here

    DigestType digestType = signatureType.getDigestType();
    return digestType;
  }

  protected String getValue(final X509Principal principal) {
    X500Name x500Name = new X500Name(principal.getName());
    RDN rdn = x500Name.getRDNs(BCStyle.CN)[0];
    return IETFUtils.valueToString(rdn.getFirst().getValue());
  }
View Full Code Here

    RDN rdn = x500Name.getRDNs(BCStyle.CN)[0];
    return IETFUtils.valueToString(rdn.getFirst().getValue());
  }

  protected String getValue(final X500Principal principal) {
    X500Name x500Name = new X500Name(principal.getName());
    RDN rdn = x500Name.getRDNs(BCStyle.CN)[0];
    return IETFUtils.valueToString(rdn.getFirst().getValue());
  }
View Full Code Here

    converter.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
    return converter.getCertificate(holder);
  }

  public static String getName(final X500Principal principal) {
    X500Name x500Name = new X500Name(principal.getName());
    return BouncyCastleProviderHelper.getName(x500Name);
  }
View Full Code Here

    X500Name x500Name = new X500Name(principal.getName());
    return BouncyCastleProviderHelper.getName(x500Name);
  }

  public static String getName(final X509Principal principal) {
    X500Name x500Name = new X500Name(principal.getName());
    return BouncyCastleProviderHelper.getName(x500Name);
  }
View Full Code Here

  }

  public static X500Principal toX500Principal(final String value) throws IOException {
    X500NameBuilder builder = new X500NameBuilder(BCStyle.INSTANCE);
    builder.addRDN(BCStyle.CN, value);
    X500Name name = builder.build();
    return BouncyCastleProviderHelper.toX500Principal(name);
  }
View Full Code Here

TOP

Related Classes of org.bouncycastle.asn1.x500.AttributeTypeAndValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.