Package org.apache.harmony.security.asn1

Examples of org.apache.harmony.security.asn1.ASN1UTCTime


  userCertificate_ = new ASN1Integer();

  crlEntry_.add(userCertificate_);

  revocationDate_ = new ASN1Choice();
  revocationDate_.addType(new ASN1UTCTime());
  revocationDate_.addType(new ASN1GeneralizedTime());

  crlEntry_.add(revocationDate_);

  crlEntryExtensions_ = new ASN1SequenceOf(X509Extension.class);
View Full Code Here


    public void setRevocationDate(Calendar cal) {

  ASN1Time inner = (ASN1Time) revocationDate_.getInnerType();

  if (inner == null) {
      inner = new ASN1UTCTime(cal);
      revocationDate_.setInnerType(inner);
  }

  inner.setDate(cal);
    }
View Full Code Here

  issuer_ = new codec.x501.Name();
  add(issuer_);

  ASN1Sequence validity = new ASN1Sequence();
  notBefore_ = new ASN1Choice();
  notBefore_.addType(new ASN1UTCTime());
  notBefore_.addType(new ASN1GeneralizedTime());
  validity.add(notBefore_);
  notAfter_ = new ASN1Choice();
  notAfter_.addType(new ASN1UTCTime());
  notAfter_.addType(new ASN1GeneralizedTime());
  validity.add(notAfter_);
  add(validity);

  subject_ = new codec.x501.Name();
View Full Code Here

    public void setNotAfter(Calendar nnaf) {

  ASN1Time nai = (ASN1Time) notAfter_.getInnerType();

  if (nai == null) {
      nai = new ASN1UTCTime();
      notAfter_.setInnerType(nai);
  }

  nai.setDate(nnaf);
    }
View Full Code Here

     */
    public void setNotBefore(Calendar nnbf) {
  ASN1Time nai = (ASN1Time) notBefore_.getInnerType();

  if (nai == null) {
      nai = new ASN1UTCTime();
      notBefore_.setInnerType(nai);
  }

  nai.setDate(nnbf);
    }
View Full Code Here

  issuer = new codec.x501.Name();
  TBSCertList.add(issuer);

  thisUpdate = new ASN1Choice();
  thisUpdate.addType(new ASN1UTCTime());
  thisUpdate.addType(new ASN1GeneralizedTime());
  TBSCertList.add(thisUpdate);

  nextUpdate = new ASN1Choice();
  nextUpdate.setOptional(true);
  nextUpdate.addType(new ASN1UTCTime());
  nextUpdate.addType(new ASN1GeneralizedTime());

  TBSCertList.add(nextUpdate);

  revokedCertificates = new ASN1SequenceOf(CRLEntry.class);
View Full Code Here

  issuer = new codec.x501.Name();
  TBSCertList.add(issuer);

  thisUpdate = new ASN1Choice();
  thisUpdate.addType(new ASN1UTCTime());
  thisUpdate.addType(new ASN1GeneralizedTime());
  TBSCertList.add(thisUpdate);

  /*
   * nextUpdate = new ASN1Choice(); nextUpdate.setOptional(true);
View Full Code Here

   * TBSCertList.add(nextUpdate);
   */

  ASN1Time akt_time = (ASN1Time) nextUpdate.getInnerType();
  if (akt_time == null) {
      akt_time = new ASN1UTCTime(time);
      nextUpdate.setInnerType(akt_time);
  }
  akt_time.setDate(time);
  nextUpdate.setOptional(false);
    }
View Full Code Here

     */
    public void setThisUpdate(Calendar time) {

  ASN1Time akt_time = (ASN1Time) thisUpdate.getInnerType();
  if (akt_time == null) {
      akt_time = new ASN1UTCTime(time);
      thisUpdate.setInnerType(akt_time);
  }

  akt_time.setDate(time);
    }
View Full Code Here

                    new byte[] { 0x03, 0x02, 0x07, (byte) 0x80 } } };

    public void testDecode_Encode() throws IOException {

        // decoder/encoder for testing
        ASN1BitString asn1 = ASN1BitString.getInstance();

        // decode from byte array
        for (int i = 0; i < validBitstring.length; i++) {
            DerInputStream in = new DerInputStream(
                    (byte[]) validBitstring[i][1]);

            BitString expected = (BitString) validBitstring[i][0];
            BitString decoded = (BitString) asn1.decode(in);

            assertEquals("Testcase: " + i, expected.unusedBits,
                    decoded.unusedBits);

            assertTrue("Testcase: " + i, Arrays.equals(expected.bytes,
                    decoded.bytes));
        }

        // decode from input stream
        for (int i = 0; i < validBitstring.length; i++) {
            DerInputStream in = new DerInputStream(new ByteArrayInputStream(
                    (byte[]) validBitstring[i][1]));

            BitString expected = (BitString) validBitstring[i][0];
            BitString decoded = (BitString) asn1.decode(in);

            assertEquals("Testcase: " + i, expected.unusedBits,
                    decoded.unusedBits);

            assertTrue("Testcase: " + i, Arrays.equals(expected.bytes,
View Full Code Here

TOP

Related Classes of org.apache.harmony.security.asn1.ASN1UTCTime

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.