ASN1Integer(byte[] bytes, boolean clone) { // Apply loose validation, see note in public constructor ANS1Integer(byte[]) if (!Properties.isOverrideSet("org.bouncycastle.asn1.allow_unsafe_integer")) { if (isMalformed(bytes)) { throw new IllegalArgumentException("malformed integer"); } } this.bytes = (clone) ? Arrays.clone(bytes) : bytes; }
/** * Constructor from encoded BigInteger. * * @param bytes the value of this enumerated as an encoded BigInteger (signed). */ public ASN1Enumerated( byte[] bytes) { if (!Properties.isOverrideSet("org.bouncycastle.asn1.allow_unsafe_integer")) { if (ASN1Integer.isMalformed(bytes)) { throw new IllegalArgumentException("malformed enumerated"); } } this.bytes = Arrays.clone(bytes); }