Package codec.asn1

Examples of codec.asn1.ASN1BitString


  if (aid == null || key == null)
      throw new NullPointerException("Some arg is null!");

  algorithm_ = aid;
  add(algorithm_);
  encodedKey_ = new ASN1BitString(key, 0);
  add(encodedKey_);
    }
View Full Code Here


  clear();

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

  try {
      dec = new DERDecoder(new ByteArrayInputStream(key.getEncoded()));
View Full Code Here

  try {
      bos = new ByteArrayOutputStream();
      enc = new DEREncoder(bos);
      key.encode(enc);
      encodedKey_ = new ASN1BitString(bos.toByteArray(), 0);
      enc.close();
      set(1, encodedKey_);
  } catch (ASN1Exception e) {
      throw new InconsistentStateException("Internal, encoding error!");
  } catch (IOException e) {
View Full Code Here

    list.add(o);
      }
      values_.clear();
      values_.addAll(list);
  } catch (ClassCastException e) {
      throw new ASN1Exception("Unexpected type in SET OF!");
  } catch (NullPointerException e) {
      throw new ASN1Exception("NULL in SET OF!");
  }
    }
View Full Code Here

      ByteArrayInputStream bais = new ByteArrayInputStream(enc);

      decode(new DERDecoder(bais));
      bais.close();
  } catch (IOException e) {
      throw new ASN1Exception(e.getMessage());
  }
    }
View Full Code Here

      encode(new DEREncoder(baos));
      res = baos.toByteArray();
      baos.close();
  } catch (IOException e) {
      throw new ASN1Exception(e.getMessage());
  }
  return res;

    }
View Full Code Here

    /**
     * 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

TOP

Related Classes of codec.asn1.ASN1BitString

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.