Examples of generate()


Examples of org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator.generate()

            {
                key = PGPUtil.makeRandomKey(defAlgorithm, rand);
                byte[] sessionInfo = createSessionInfo(defAlgorithm, key);
                PGPKeyEncryptionMethodGenerator m = (PGPKeyEncryptionMethodGenerator)methods.get(0);

                pOut.writePacket(m.generate(defAlgorithm, sessionInfo));
            }
        }
        else // multiple methods
        {
            key = PGPUtil.makeRandomKey(defAlgorithm, rand);
View Full Code Here

Examples of org.bouncycastle.openpgp.operator.PGPKeyEncryptionMethodGenerator.generate()

            {
                key = PGPUtil.makeRandomKey(defAlgorithm, rand);
                byte[] sessionInfo = createSessionInfo(defAlgorithm, key);
                PGPKeyEncryptionMethodGenerator m = (PGPKeyEncryptionMethodGenerator)methods.get(0);

                pOut.writePacket(m.generate(defAlgorithm, sessionInfo));
            }
        }
        else // multiple methods
        {
            key = PGPUtil.makeRandomKey(defAlgorithm, rand);
View Full Code Here

Examples of org.bouncycastle.tsp.TimeStampRequestGenerator.generate()

        // generate TSA request
        TimeStampRequestGenerator tsaGenerator = new TimeStampRequestGenerator();
        tsaGenerator.setCertReq(true);
        ASN1ObjectIdentifier oid = getHashObjectIdentifier(digest.getAlgorithm());
        TimeStampRequest request = tsaGenerator.generate(oid, hash, BigInteger.valueOf(nonce));

        // get TSA response
        byte[] tsaResponse = getTSAResponse(request.getEncoded());

        TimeStampResponse response;
View Full Code Here

Examples of org.bouncycastle.tsp.TimeStampResponseGenerator.generate()

  @Override
  public byte[] getTimeStamp(final byte[] request) {
    try {
      TimeStampRequest timeStampRequest = new TimeStampRequest(request);
      TimeStampResponseGenerator timeStampResponseGenerator = new TimeStampResponseGenerator(this.timeStampTokenGenerator, TSPAlgorithms.ALLOWED);
      TimeStampResponse timeStampResponse = timeStampResponseGenerator.generate(timeStampRequest, this.getSerialNumber(), new Date());

      timeStampResponse.validate(timeStampRequest);

      return timeStampResponse.getEncoded();
    } catch (Exception e) {
View Full Code Here

Examples of org.bouncycastle.x509.X509V1CertificateGenerator.generate()

        certGen1.setNotAfter(new Date(System.currentTimeMillis() + 50000));
        certGen1.setSubjectDN(new X509Principal(ord, values));
        certGen1.setPublicKey(pubKey);
        certGen1.setSignatureAlgorithm("MD5WithRSAEncryption");

        cert = certGen1.generate(privKey);

        cert.checkValidity(new Date());

        cert.verify(pubKey);
View Full Code Here

Examples of org.bouncycastle.x509.X509V2AttributeCertificateGenerator.generate()

                new DERSequence(roleSyntax));

        acGen.addAttribute(attributes);

        //      finally create the AC
        X509V2AttributeCertificate att = (X509V2AttributeCertificate)acGen
                .generate(caPrivKey, "BC");

        //
        // starting here, we parse the newly generated AC
        //
View Full Code Here

Examples of org.bouncycastle.x509.X509V2CRLGenerator.generate()

       
        crlGen.addCRLEntry(BigInteger.ONE, now, CRLReason.privilegeWithdrawn);
       
        crlGen.addExtension(X509Extensions.AuthorityKeyIdentifier, false, new AuthorityKeyIdentifierStructure(pair.getPublic()));
       
        X509CRL    crl = crlGen.generate(pair.getPrivate(), "BC");
       
        if (!crl.getIssuerX500Principal().equals(new X500Principal("CN=Test CA")))
        {
            fail("failed CRL issuer test");
        }
View Full Code Here

Examples of org.bouncycastle.x509.X509V3CertificateGenerator.generate()

        certGen.setNotAfter(new Date(System.currentTimeMillis() + 50000));
        certGen.setSubjectDN(new X509Principal("CN=Test"));
        certGen.setPublicKey(vKey);
        certGen.setSignatureAlgorithm("GOST3411withGOST3410");

        X509Certificate cert = certGen.generate(sKey, "BC");

        ks.setKeyEntry("gost",sKey, "gost".toCharArray(), new Certificate[] { cert });

        ByteArrayOutputStream bOut = new ByteArrayOutputStream();
View Full Code Here

Examples of org.byteliberi.easydriver.generator.BeanFactoryGeneration.generate()

     
      final ObjectModelGeneration omGen = new ObjectModelGeneration(metaData, packageName);
      omGen.generate(baseDir);
     
      final BeanFactoryGeneration beanGen = new BeanFactoryGeneration(metaData, packageName);
      beanGen.generate(baseDir);
     
      final ServiceGeneration serviceGen = new ServiceGeneration(metaData, packageName);
      serviceGen.generate(baseDir);
    }
    finally {
View Full Code Here

Examples of org.byteliberi.easydriver.generator.ObjectModelGeneration.generate()

                  
      final StructureGeneration structure = new StructureGeneration(metaData, packageName);
      structure.generate(baseDir);
     
      final ObjectModelGeneration omGen = new ObjectModelGeneration(metaData, packageName);
      omGen.generate(baseDir);
     
      final BeanFactoryGeneration beanGen = new BeanFactoryGeneration(metaData, packageName);
      beanGen.generate(baseDir);
     
      final ServiceGeneration serviceGen = new ServiceGeneration(metaData, packageName);
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.