Defensive copy for getKeyUsage return value
import org.bouncycastle.jce.X509Principal;
import org.bouncycastle.jce.interfaces.PKCS12BagAttributeCarrier;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.util.Arrays;
import org.bouncycastle.util.Integers;
import org.bouncycastle.util.Strings;
import org.bouncycastle.util.encoders.Hex;
@@ -323,7 +324,7 @@ public String getSigAlgOID()
public boolean[] getKeyUsage()
{
- return keyUsage;
+ return Arrays.clone(keyUsage);
}
public List getExtendedKeyUsage()
