/** * Basic constructor * * @param string the string to be carried in the VisibleString object, */ public DERVisibleString( String string) { this.string = Strings.toByteArray(string); }
/** * Basic constructor - with string 8 bit assumed. * * @param string the string to be wrapped. */ public DERT61String( String string) { this.string = Strings.toByteArray(string); }
/** * basic constructor - with string 8 bit assumed. * * @param string the string to be wrapped. */ public DERT61String( String string) { this(Strings.toByteArray(string)); }
/** * Construct a GeneralString from the passed in String. * * @param string the string to be contained in this object. */ public DERGeneralString(String string) { this.string = Strings.toByteArray(string); }
public byte[] getHeader() { return Strings.toByteArray(enc); } }
/** * Basic constructor */ public DERVisibleString( String string) { this.string = Strings.toByteArray(string); }
public DERGeneralString(String string) { this.string = Strings.toByteArray(string); }
/** * Base constructor from a java.util.date object * * @param time a date object representing the time of interest. */ public ASN1GeneralizedTime( Date time) { SimpleDateFormat dateF = new SimpleDateFormat("yyyyMMddHHmmss'Z'", DateUtil.EN_Locale); dateF.setTimeZone(new SimpleTimeZone(0, "Z")); this.time = Strings.toByteArray(dateF.format(time)); }
/** * Base constructor from a java.util.date object * @param time the Date to build the time from. */ public ASN1UTCTime( Date time) { SimpleDateFormat dateF = new SimpleDateFormat("yyMMddHHmmss'Z'", DateUtil.EN_Locale); dateF.setTimeZone(new SimpleTimeZone(0,"Z")); this.time = Strings.toByteArray(dateF.format(time)); }
/** * Base constructor from a java.util.date object * * @param time a date object representing the time of interest. */ public ASN1GeneralizedTime( Date time) { SimpleDateFormat dateF = new SimpleDateFormat("yyyyMMddHHmmss'Z'"); dateF.setTimeZone(new SimpleTimeZone(0, "Z")); this.time = Strings.toByteArray(dateF.format(time)); }
/** * base constructor from a java.util.date object * @param time the Date to build the time from. */ public ASN1UTCTime( Date time) { SimpleDateFormat dateF = new SimpleDateFormat("yyMMddHHmmss'Z'"); dateF.setTimeZone(new SimpleTimeZone(0,"Z")); this.time = Strings.toByteArray(dateF.format(time)); }
/** * Base constructor from a java.util.date and Locale - you may need to use this if the default locale * doesn't use a Gregorian calender so that the GeneralizedTime produced is compatible with other ASN.1 implementations. * * @param time a date object representing the time of interest. * @param locale an appropriate Locale for producing an ASN.1 GeneralizedTime value. */ public ASN1GeneralizedTime( Date time, Locale locale) { SimpleDateFormat dateF = new SimpleDateFormat("yyyyMMddHHmmss'Z'", locale); dateF.setTimeZone(new SimpleTimeZone(0, "Z")); this.time = Strings.toByteArray(dateF.format(time)); }
/** * Base constructor from a java.util.date and Locale - you may need to use this if the default locale * doesn't use a Gregorian calender so that the GeneralizedTime produced is compatible with other ASN.1 implementations. * * @param time a date object representing the time of interest. * @param locale an appropriate Locale for producing an ASN.1 UTCTime value. */ public ASN1UTCTime( Date time, Locale locale) { SimpleDateFormat dateF = new SimpleDateFormat("yyMMddHHmmss'Z'", locale); dateF.setTimeZone(new SimpleTimeZone(0,"Z")); this.time = Strings.toByteArray(dateF.format(time)); }
public void writeString(String str) { rawArray(Strings.toByteArray(str)); }
private static byte[] generateDefaultPersonalizationString(byte[] seed) { return Arrays.concatenate(Strings.toByteArray("Default"), seed, Pack.longToBigEndian(Thread.currentThread().getId()), Pack.longToBigEndian(System.currentTimeMillis())); }
private static byte[] generateNonceIVPersonalizationString(byte[] seed) { return Arrays.concatenate(Strings.toByteArray("Nonce"), seed, Pack.longToLittleEndian(Thread.currentThread().getId()), Pack.longToLittleEndian(System.currentTimeMillis())); }
public static byte[] PRF_legacy(byte[] secret, String asciiLabel, byte[] seed, int size) { byte[] label = Strings.toByteArray(asciiLabel); byte[] labelSeed = concat(label, seed); return PRF_legacy(secret, label, labelSeed, size); }
public static byte[] PRF_legacy(byte[] secret, String asciiLabel, byte[] seed, int size) { byte[] label = Strings.toByteArray(asciiLabel); byte[] labelSeed = concat(label, seed); return PRF_legacy(secret, label, labelSeed, size); }
private byte[] PRF(TLSKeyMaterialSpec parameters, Mac prf) { byte[] label = Strings.toByteArray(parameters.getLabel()); byte[] labelSeed = Arrays.concatenate(label, parameters.getSeed()); byte[] secret = parameters.getSecret(); byte[] buf = new byte[parameters.getLength()]; hmac_hash(prf, secret, labelSeed, buf); return buf; } }
HybridSecureRandom() { super(null, new HybridRandomProvider()); drbg = new SP800SecureRandomBuilder(new EntropySourceProvider() { public EntropySource get(final int bitsRequired) { return new SignallingEntropySource(bitsRequired); } }) .setPersonalizationString(Strings.toByteArray("Bouncy Castle Hybrid Entropy Source")) .buildHMAC(new HMac(new SHA512Digest()), baseRandom.generateSeed(32), false); // 32 byte nonce }