Examples of DERNull


Examples of org.bouncycastle.asn1.DERNull

        assertEquals(name.toString(), userDN);

        PKIBody body = respObject.getBody();
        int tag = body.getTagNo();
        assertEquals(tag, 19);
        DERNull n = body.getConf();
        assertNotNull(n);
    }
View Full Code Here

Examples of org.bouncycastle.asn1.DERNull

        Vector<KeyPurposeId> usage = new Vector<KeyPurposeId>();
        usage.add(KeyPurposeId.id_kp_codeSigning);
        ExtendedKeyUsage eku = new ExtendedKeyUsage(usage);
        extgen.addExtension(X509Extensions.ExtendedKeyUsage, false, eku);
        // OcspNoCheck
        extgen.addExtension(OCSPObjectIdentifiers.id_pkix_ocsp_nocheck, false, new DERNull());
        // Netscape cert type
        extgen.addExtension(new DERObjectIdentifier("2.16.840.1.113730.1.1"), false, new NetscapeCertType(NetscapeCertType.objectSigningCA));
        // My completely own
        extgen.addExtension(new DERObjectIdentifier("1.1.1.1.1"), false, new DERIA5String("PrimeKey"));
View Full Code Here

Examples of org.bouncycastle.asn1.DERNull

            final CertReqMsg myCertReqMsg = new CertReqMsg(certRequest);

            ProofOfPossession myProofOfPossession;
            if (raVerifiedPopo) {
                // raVerified POPO (meaning there is no POPO)
                myProofOfPossession = new ProofOfPossession(new DERNull(), 0);
            } else {
                final ByteArrayOutputStream baos = new ByteArrayOutputStream();
                final DEROutputStream mout = new DEROutputStream( baos );
                mout.writeObject( certRequest );
                mout.close();
View Full Code Here

Examples of org.bouncycastle.asn1.DERNull

            }
            if ( body.getTagNo()!=19 ) {
                StressTest.this.performanceTest.getLog().error("Cert body tag not 19.");
                return false;
            }
            final DERNull n = body.getConf();
            if ( n==null ) {
                StressTest.this.performanceTest.getLog().error("Confirmation is null.");
                return false;
            }
            return true;
View Full Code Here

Examples of org.bouncycastle.asn1.DERNull

        return null;
      }
      // This can sometimes be a 0 length Octet string it seems
      if (obj instanceof DEROctetString) {
        //DEROctetString o = (DEROctetString) obj;
        return new DERNull();
      }
      return (DERNull)this.obj;
    }
View Full Code Here

Examples of org.bouncycastle.asn1.DERNull

            signerinfo.add(new DERSequence(v));

            // Add the digestAlgorithm
            v = new ASN1EncodableVector();
            v.add(new DERObjectIdentifier(digestAlgorithm));
            v.add(new DERNull());
            signerinfo.add(new DERSequence(v));

            // add the authenticated attribute if present
            if (secondDigest != null && signingTime != null) {
                signerinfo.add(new DERTaggedObject(false, 0, getAuthenticatedAttributeSet(secondDigest, signingTime, ocsp)));
            }
            // Add the digestEncryptionAlgorithm
            v = new ASN1EncodableVector();
            v.add(new DERObjectIdentifier(digestEncryptionAlgorithm));
            v.add(new DERNull());
            signerinfo.add(new DERSequence(v));

            // Add the digest
            signerinfo.add(new DEROctetString(digest));
View Full Code Here

Examples of org.bouncycastle.asn1.DERNull

                }else
                  if(encoding.equalsIgnoreCase(ENCODING_DERIA5STRING)){
                    toret = parseDERIA5String(value);
                  }else
                    if(encoding.equalsIgnoreCase(ENCODING_DERNULL)){
                      toret = new DERNull();
                    }else
                      if(encoding.equalsIgnoreCase(ENCODING_DEROBJECT)){
                        toret = parseHexEncodedDERObject(value);
                      }else
                        if(encoding.equalsIgnoreCase(ENCODING_DEROID)){
View Full Code Here

Examples of org.bouncycastle.asn1.DERNull

      if (LOG.isDebugEnabled()) {
        LOG.debug("Selected signature alg oid: "+oid.getId());
      }
      // According to PKCS#1 AlgorithmIdentifier for RSA-PKCS#1 has null Parameters, this means a DER Null (asn.1 encoding of null), not Java null.
      // For the RSA signature algorithms specified above RFC3447 states "...the parameters MUST be present and MUST be NULL."
    pKIMessage.getHeader().setProtectionAlg(new AlgorithmIdentifier(oid, new DERNull()));
    // Most PKCS#11 providers don't like to be fed an OID as signature algorithm, so
    // we use BC classes to translate it into a signature algorithm name instead
    final String sigAlg = new BasicOCSPResp(new BasicOCSPResponse(null, new AlgorithmIdentifier(oid), null, null)).getSignatureAlgName();
      if (LOG.isDebugEnabled()) {
        LOG.debug("Signing CMP message with signature alg: "+sigAlg);
View Full Code Here

Examples of org.bouncycastle.asn1.DERNull

      SignRequestException, NotFoundException {

    X509Name sender = X509Name.getInstance(getSender().getName());
    X509Name recipient = X509Name.getInstance(getRecipient().getName());
    PKIHeader myPKIHeader = CmpMessageHelper.createPKIHeader(sender, recipient, getSenderNonce(), getRecipientNonce(), getTransactionId());
    PKIBody myPKIBody = new PKIBody(new DERNull(), 19);
    PKIMessage myPKIMessage = new PKIMessage(myPKIHeader, myPKIBody);

    if ((getPbeDigestAlg() != null) && (getPbeMacAlg() != null) && (getPbeKeyId() != null) && (getPbeKey() != null) ) {
      responseMessage = CmpMessageHelper.protectPKIMessageWithPBE(myPKIMessage, getPbeKeyId(), getPbeKey(), getPbeDigestAlg(), getPbeMacAlg(), getPbeIterationCount());
    } else {
View Full Code Here

Examples of org.bouncycastle.asn1.DERNull

    super.setCriticalFlag(false);
  }
 
  @Override
  public DEREncodable getValue(final UserDataVO subject, final CA ca, final CertificateProfile certProfile, final PublicKey userPublicKey, final PublicKey caPublicKey ) throws CertificateExtentionConfigurationException, CertificateExtensionException {
    return new DERNull();
 
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.