Example usage for org.bouncycastle.util Arrays copyOf

List of usage examples for org.bouncycastle.util Arrays copyOf

Introduction

In this page you can find the example usage for org.bouncycastle.util Arrays copyOf.

Prototype

public static BigInteger[] copyOf(BigInteger[] original, int newLength) 

Source Link

Usage

From source file:com.github.horrorho.inflatabledonkey.data.blob.BlobA4.java

License:Open Source License

public byte[] uid() {
    return Arrays.copyOf(uid, uid.length);
}

From source file:com.github.horrorho.inflatabledonkey.data.blob.BlobA4.java

License:Open Source License

public byte[] salt() {
    return Arrays.copyOf(salt, salt.length);
}

From source file:com.github.horrorho.inflatabledonkey.data.blob.BlobA4.java

License:Open Source License

public byte[] ephemeralKey() {
    return Arrays.copyOf(ephemeralKey, ephemeralKey.length);
}

From source file:com.github.horrorho.inflatabledonkey.data.der.EncryptedKey.java

License:Open Source License

public EncryptedKey(NOS masterKey, byte[] wrappedKey, Optional<Integer> flags) {
    this.masterKey = Objects.requireNonNull(masterKey, "masterKey");
    this.wrappedKey = Arrays.copyOf(wrappedKey, wrappedKey.length);
    this.flags = Objects.requireNonNull(flags, "flags");
}

From source file:com.github.horrorho.inflatabledonkey.data.der.EncryptedKey.java

License:Open Source License

public byte[] wrappedKey() {
    return Arrays.copyOf(wrappedKey, wrappedKey.length);
}

From source file:com.github.horrorho.inflatabledonkey.keybag.KeyBag.java

License:Open Source License

public KeyBag(KeyBagType type, byte[] uuid, Map<Integer, byte[]> publicKeys, Map<Integer, byte[]> privateKeys) {

    this.type = Objects.requireNonNull(type, "type");
    this.uuid = Objects.requireNonNull(uuid, "uuid");
    this.uuidBase64 = Base64.getEncoder().encodeToString(uuid);

    this.publicKeys = publicKeys.entrySet().stream().collect(
            Collectors.toMap(Map.Entry::getKey, bs -> Arrays.copyOf(bs.getValue(), bs.getValue().length)));

    this.privateKeys = privateKeys.entrySet().stream().collect(
            Collectors.toMap(Map.Entry::getKey, bs -> Arrays.copyOf(bs.getValue(), bs.getValue().length)));
}

From source file:com.github.horrorho.inflatabledonkey.pcs.xzone.ProtectionZone.java

License:Open Source License

Optional<byte[]> kdk() {
    return keyDerivationKey.map(bs -> Arrays.copyOf(bs, bs.length));
}

From source file:com.github.horrorho.inflatabledonkey.pcs.xzone.ProtectionZone.java

License:Open Source License

Optional<byte[]> dk() {
    return derivedKey.map(bs -> Arrays.copyOf(bs, bs.length));
}

From source file:com.github.horrorho.inflatabledonkey.pcs.xzone.XZone.java

License:Open Source License

public XZone(String protectionTag, byte[] kdk, byte[] dk, Collection<Key<ECPrivate>> keys) {
    this.protectionTag = Objects.requireNonNull(protectionTag, "protectionTag");
    this.kdk = Arrays.copyOf(kdk, kdk.length);
    this.dk = Arrays.copyOf(dk, dk.length);
    this.keys = new ArrayList<>(keys);
}

From source file:com.github.horrorho.inflatabledonkey.pcs.xzone.XZone.java

License:Open Source License

public XZone(String protectionTag, byte[] kdk, byte[] dk) {
    this.protectionTag = Objects.requireNonNull(protectionTag, "protectionTag");
    this.kdk = Arrays.copyOf(kdk, kdk.length);
    this.dk = Arrays.copyOf(dk, dk.length);
    this.keys = new ArrayList<>();
}