Examples of toASN1Primitive()


Examples of org.bouncycastle.asn1.pkcs.PKCS12PBEParams.toASN1Primitive()

            String name = (String)ks.nextElement();
            PrivateKey privKey = (PrivateKey)keys.get(name);
            PKCS12PBEParams kParams = new PKCS12PBEParams(kSalt, MIN_ITERATIONS);
            byte[] kBytes = wrapKey(keyAlgorithm.getId(), privKey, kParams, password);
            AlgorithmIdentifier kAlgId = new AlgorithmIdentifier(keyAlgorithm, kParams.toASN1Primitive());
            org.bouncycastle.asn1.pkcs.EncryptedPrivateKeyInfo kInfo = new org.bouncycastle.asn1.pkcs.EncryptedPrivateKeyInfo(kAlgId, kBytes);
            boolean attrSet = false;
            ASN1EncodableVector kName = new ASN1EncodableVector();

            if (privKey instanceof PKCS12BagAttributeCarrier)
View Full Code Here

Examples of org.bouncycastle.asn1.pkcs.PKCS12PBEParams.toASN1Primitive()

        random.nextBytes(cSalt);

        ASN1EncodableVector certSeq = new ASN1EncodableVector();
        PKCS12PBEParams cParams = new PKCS12PBEParams(cSalt, MIN_ITERATIONS);
        AlgorithmIdentifier cAlgId = new AlgorithmIdentifier(certAlgorithm, cParams.toASN1Primitive());
        Hashtable doneCerts = new Hashtable();

        Enumeration cs = keys.keys();
        while (cs.hasMoreElements())
        {
View Full Code Here

Examples of org.bouncycastle.asn1.sec.ECPrivateKeyStructure.toASN1Primitive()

        try
        {
            if (algorithm.equals("ECGOST3410"))
            {
                info = new PrivateKeyInfo(new AlgorithmIdentifier(CryptoProObjectIdentifiers.gostR3410_2001, params.toASN1Primitive()), keyStructure.toASN1Primitive());
            }
            else
            {

                info = new PrivateKeyInfo(new AlgorithmIdentifier(X9ObjectIdentifiers.id_ecPublicKey, params.toASN1Primitive()), keyStructure.toASN1Primitive());
View Full Code Here

Examples of org.bouncycastle.asn1.sec.ECPrivateKeyStructure.toASN1Primitive()

                info = new PrivateKeyInfo(new AlgorithmIdentifier(CryptoProObjectIdentifiers.gostR3410_2001, params.toASN1Primitive()), keyStructure.toASN1Primitive());
            }
            else
            {

                info = new PrivateKeyInfo(new AlgorithmIdentifier(X9ObjectIdentifiers.id_ecPublicKey, params.toASN1Primitive()), keyStructure.toASN1Primitive());
            }

            return info.getEncoded(ASN1Encoding.DER);
        }
        catch (IOException e)
View Full Code Here

Examples of org.bouncycastle.asn1.x509.GeneralName.toASN1Primitive()

    // Colocar aqui 1.3.6.1.5.5.7.48.1
    for (AccessDescription description : accessDescriptions) {
      if (description.getAccessMethod().getId().equals(OCSPObjectIdentifiers.pkix_ocsp)) {
        GeneralName generalName = description.getAccessLocation();
        DERTaggedObject taggedObject = (DERTaggedObject) generalName.toASN1Primitive();
        DERIA5String ia5String = DERIA5String.getInstance(taggedObject.getObject());
        String urlStr = ia5String.getString();
        URL url = new URL(urlStr);
        urls.add(url);
      }
View Full Code Here

Examples of org.bouncycastle.asn1.x509.GeneralName.toASN1Primitive()

    // Colocar aqui 1.3.6.1.5.5.7.48.1
    for (AccessDescription description : accessDescriptions) {
      if (description.getAccessMethod().getId().equals(OCSPObjectIdentifiers.pkix_ocsp)) {
        GeneralName generalName = description.getAccessLocation();
        DERTaggedObject taggedObject = (DERTaggedObject) generalName.toASN1Primitive();
        DERIA5String ia5String = DERIA5String.getInstance(taggedObject.getObject());
        String urlStr = ia5String.getString();
        URL url = new URL(urlStr);
        urls.add(url);
      }
View Full Code Here

Examples of org.bouncycastle.asn1.x509.GeneralName.toASN1Primitive()

    // Colocar aqui 1.3.6.1.5.5.7.48.1
    for (AccessDescription description : accessDescriptions) {
      if (description.getAccessMethod().getId().equals(OCSPObjectIdentifiers.pkix_ocsp)) {
        GeneralName generalName = description.getAccessLocation();
        DERTaggedObject taggedObject = (DERTaggedObject) generalName.toASN1Primitive();
        DERIA5String ia5String = DERIA5String.getInstance(taggedObject.getObject());
        String urlStr = ia5String.getString();
        URL url = new URL(urlStr);
        urls.add(url);
      }
View Full Code Here

Examples of org.bouncycastle.asn1.x509.GeneralNames.toASN1Primitive()

        }
      }

      if (vector.size() > 0) {
        GeneralNames subjectAltName = GeneralNames.getInstance(new DERSequence(vector));
        builder.addExtension(X509Extension.subjectAlternativeName, false, subjectAltName.toASN1Primitive());
      }
    }
  }

  protected void addV3CRLDistPoint(final JcaX509v3CertificateBuilder builder, final BouncyCastleCertificateRequest request) throws CertIOException {
View Full Code Here

Examples of org.bouncycastle.asn1.x509.GeneralNames.toASN1Primitive()

        }
      }

      if (vector.size() > 0) {
        GeneralNames subjectAltName = GeneralNames.getInstance(new DERSequence(vector));
        builder.addExtension(X509Extension.subjectAlternativeName, false, subjectAltName.toASN1Primitive());
      }
    }
  }

  protected void addV3CRLDistPoint(final JcaX509v3CertificateBuilder builder, final BouncyCastleCertificateRequest request) throws CertIOException {
View Full Code Here

Examples of org.bouncycastle.asn1.x509.GeneralNames.toASN1Primitive()

        }
      }

      if (vector.size() > 0) {
        GeneralNames subjectAltName = GeneralNames.getInstance(new DERSequence(vector));
        builder.addExtension(X509Extension.subjectAlternativeName, false, subjectAltName.toASN1Primitive());
      }
    }
  }

  protected void addV3CRLDistPoint(final JcaX509v3CertificateBuilder builder, final BouncyCastleCertificateRequest request) throws CertIOException {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.