Examples of BerFactory


Examples of ca.carleton.gcrc.security.ber.BerFactory

    } catch(Exception e) {
      throw new Exception("Error during encryption of token", e);
    }
   
    // Encode
    BerFactory factory = new BerImplementation();
    BerConstructed outer = factory.createConstructed(
        BerObject.TypeClass.APPLICATION
        ,Token.APPLICATION_TYPE_ENCRYPTED
        );
   
    // Context
    BerBytes berContext = factory.createOctetString();
    berContext.setValue(context);
    outer.add(berContext);
   
    // Encrypted Token
    BerBytes berEncrypted = factory.createOctetString();
    berEncrypted.setValue(encrypted);
    outer.add(berEncrypted);
   
    byte[] result = BerEncoder.encode(outer);
    return result;
View Full Code Here

Examples of ca.carleton.gcrc.security.ber.BerFactory

    this.version = version;
  }
 
  @Override
  public byte[] encode() throws Exception {
    BerFactory factory = new BerImplementation();
   
    BerConstructed outer = factory.createConstructed(
      BerObject.TypeClass.APPLICATION
      ,Token.APPLICATION_TYPE_PASSWORD_RECOVERY
      );
   
    BerString email = factory.createUTF8String();
    email.setValue(emailAddress);
    outer.add(email);
   
    long expiryMs = expiry.getTime();
    Long expiryLong = new Long(expiryMs);
    BerInteger date = factory.createInteger();
    date.setValue( expiryLong );
    outer.add(date);

    BerString berVersion = factory.createUTF8String();
    berVersion.setValue(version);
    outer.add(berVersion);
   
    byte[] result = BerEncoder.encode(outer);
    return result;
View Full Code Here

Examples of ca.carleton.gcrc.security.ber.BerFactory

    this.expiry = expiry;
  }
 
  @Override
  public byte[] encode() throws Exception {
    BerFactory factory = new BerImplementation();
   
    BerConstructed outer = factory.createConstructed(
      BerObject.TypeClass.APPLICATION
      ,Token.APPLICATION_TYPE_CREATION
      );
   
    BerString email = factory.createUTF8String();
    email.setValue(emailAddress);
    outer.add(email);
   
    long expiryMs = expiry.getTime();
    Long expiryLong = new Long(expiryMs);
    BerInteger date = factory.createInteger();
    date.setValue( expiryLong );
    outer.add(date);
   
    byte[] result = BerEncoder.encode(outer);
    return result;
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.