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;