Package codec.asn1

Examples of codec.asn1.ASN1Choice


    /**
     * This constructor builds the data structure.
     */
    public PrivateKeyInfo() {
  version_ = new ASN1Integer(VERSION);
  add(version_);

  algorithm_ = new AlgorithmIdentifier();
  add(algorithm_);

View Full Code Here


     *                the raw algorithm that belongs to the given key.
     * @param key
     *                The raw key that shall be wrapped in this instance.
     */
    public PrivateKeyInfo(AlgorithmIdentifier aid, byte[] key) {
  version_ = new ASN1Integer(VERSION);
  add(version_);

  algorithm_ = aid;
  add(algorithm_);

View Full Code Here

    public PrivateKeyInfo(AlgorithmIdentifier aid, ASN1Type key) {
  ByteArrayOutputStream bos;
  DEREncoder enc;
  byte[] code;

  version_ = new ASN1Integer(VERSION);
  add(version_);

  algorithm_ = aid;
  add(algorithm_);
View Full Code Here

  DERDecoder dec;

  clear();

  version_ = new ASN1Integer(VERSION);
  add(version_);

  algorithm_ = new AlgorithmIdentifier();
  add(algorithm_);
View Full Code Here

     *
     * @param version
     *                The version number.
     */
    public void setVersion(int version) {
  version_ = new ASN1Integer(version);
  set(0, version_);
    }
View Full Code Here

  add(mac_);

  macSalt_ = new ASN1OctetString();
  add(macSalt_);

  iter_ = new ASN1Integer();
  iter_.setOptional(true);
  add(iter_);
    }
View Full Code Here

  add(mac_);

  macSalt_ = new ASN1OctetString(salt);
  add(macSalt_);

  iter_ = new ASN1Integer(it);
  if (it == 1) // default value?
      iter_.setOptional(true);
  add(iter_);
    }
View Full Code Here

  super(3);

  certificationRequestInfo_ = new ASN1Sequence();

  version_ = new ASN1Integer(0);
  certificationRequestInfo_.add(version_);

  subject_ = new Name();
  certificationRequestInfo_.add(subject_);
View Full Code Here

  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

  Attribute attrUserFn = null;
  Attribute attrUserKeyId = null;

  // Add friendlyName (if present)
  if ((user_fn != null) && !user_fn.equals("")) {
      ASN1ObjectIdentifier fnOID = new ASN1ObjectIdentifier(FN_OID_);
      attrUserFn = new Attribute(fnOID, new ASN1BMPString(user_fn));
  }

  // add localKeyId (if present)
  if ((lk_id != null) && (lk_id.length > 0)) {
      ASN1ObjectIdentifier lkOID = new ASN1ObjectIdentifier(LK_OID_);
      attrUserKeyId = new Attribute(lkOID, new ASN1OctetString(lk_id));
  }

  // both present -> add both
  if ((user_fn != null) && (lk_id != null)) {
View Full Code Here

TOP

Related Classes of codec.asn1.ASN1Choice

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.