Package org.apache.geronimo.crypto.asn1

Examples of org.apache.geronimo.crypto.asn1.ASN1Null


  if (oid == null) {
      throw new NullPointerException("Need an OID!");
  }
  if (value == null) {
      value = new ASN1Null();
  }
  type_ = oid;
  values_ = new ASN1Set(1);

  values_.add(value);
View Full Code Here


   * resolves the ANY DEFINED BY type. If the statement info is never
   * actually required then an ASN1Opaque may be used to save the overhead
   * of actually decoding the info. --volker roth
   */
  oid_ = new ASN1ObjectIdentifier();
  info_ = new ASN1Null();
  info_.setOptional(true);
  add(oid_);
  add(info_);
    }
View Full Code Here

        oid_ = new ASN1ObjectIdentifier(oid);

        if (oid.equals("2.1.0.2.0"))
        {
            parameter_ = new ASN1Null();
        }
        else if (oid.equals("2.1.0.2.2"))
        {
            parameter_ = new ASN1Integer((BigInteger)obj);
        }
View Full Code Here

        oid_ = new ASN1ObjectIdentifier(oid);

        if (oid.equals("2.1.0.2.0"))
        {
            parameter_ = new ASN1Null();
        }
        else if (oid.equals("2.1.0.2.2"))
        {
            parameter_ = new ASN1Integer((BigInteger)obj);
        }
View Full Code Here

     */
    public ASN1Type resolve(ASN1Type caller) throws ResolverException
    {
        if (oid_.toString().equals("2.1.0.2.0"))
        {
            return new ASN1Null();
        }
        else if (oid_.toString().equals("2.1.0.2.2"))
        {
            return new ASN1Integer();
        }
View Full Code Here

      throw new NoSuchAlgorithmException(
        "Cannot resolve signature algorithm!");
  }
  try {
      dAlg_ = new AlgorithmIdentifier(new ASN1ObjectIdentifier(d),
        new ASN1Null());
      cAlg_ = new AlgorithmIdentifier(new ASN1ObjectIdentifier(c),
        new ASN1Null());
  } catch (ASN1Exception e) {
      throw new InconsistentStateException(e);
  }
  /* Digest Algorithm Identifier */
  add(dAlg_);
 
View Full Code Here

      throw new NoSuchAlgorithmException(
        "Cannot resolve signature algorithm!");
  }
  try {
      dAlg_ = new AlgorithmIdentifier(new ASN1ObjectIdentifier(d),
        new ASN1Null());
      cAlg_ = new AlgorithmIdentifier(new ASN1ObjectIdentifier(c),
        new ASN1Null());
  } catch (ASN1Exception e) {
      throw new InconsistentStateException(e);
  }
  /* Digest Algorithm Identifier */
  add(dAlg_);
 
View Full Code Here

    /**
     * This method returns a X509Name object corresponding to the subject in a given certificate
     * @param cert Certificate from which subject needs to be retrieved
     */
    public static X509Name getSubjectX509Name(Certificate cert) throws CertificateEncodingException, IOException {
        ASN1InputStream ais = new ASN1InputStream(cert.getEncoded());
        X509CertificateStructure x509Struct = new X509CertificateStructure((ASN1Sequence)ais.readObject());
        ais.close();
        return x509Struct.getSubject();
    }
View Full Code Here

    /**
     * This method returns a X509Name object corresponding to a given principal
     */
    public static X509Name getX509Name(X500Principal principal) throws CertificateEncodingException, IOException {
        ASN1InputStream ais = new ASN1InputStream(principal.getEncoded());
        X509Name name = new X509Name((ASN1Sequence)ais.readObject());
        ais.close();
        return name;
    }
View Full Code Here

     * @return a Map with Subject, public-key and challenge
     */
    public static Map processSPKAC(String spkac) throws IOException, NoSuchAlgorithmException, InvalidKeyException, SignatureException, Exception {
        Map map = new HashMap();
        byte[]data = Base64.decode(spkac);
        ASN1InputStream ais = new ASN1InputStream(new ByteArrayInputStream(data));
        DERSequence spkacSeq = (DERSequence)ais.readObject();

        // SPKAC = SEQ {PKAC, SIGN-ALG, SIGN}
        // Get PKAC and obtain PK and C
        DERSequence pkacSeq = (DERSequence)spkacSeq.getObjectAt(0);
        DERObject pk = (DERObject)pkacSeq.getObjectAt(0);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.crypto.asn1.ASN1Null

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.