8234042: Better factory production of certificates

Reviewed-by: weijun, rhalade, mschoene
This commit is contained in:
Sean Mullan 2020-01-17 08:04:14 -05:00
parent 1bfcf768f5
commit da6daad2e5
7 changed files with 44 additions and 5 deletions

View file

@ -254,6 +254,9 @@ public final class PKCS12Attribute implements KeyStore.Entry.Attribute {
private void parse(byte[] encoded) throws IOException {
DerInputStream attributeValue = new DerInputStream(encoded);
DerValue[] attrSeq = attributeValue.getSequence(2);
if (attrSeq.length != 2) {
throw new IOException("Invalid length for PKCS12Attribute");
}
ObjectIdentifier type = attrSeq[0].getOID();
DerInputStream attrContent =
new DerInputStream(attrSeq[1].toByteArray());