src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 1640,1650 ****
String alias = e.nextElement();
Entry entry = entries.get(alias);
// certificate chain
! int chainLen = 1;
Certificate[] certs = null;
if (entry instanceof PrivateKeyEntry) {
PrivateKeyEntry keyEntry = (PrivateKeyEntry) entry;
if (keyEntry.chain == null) {
--- 1640,1650 ----
String alias = e.nextElement();
Entry entry = entries.get(alias);
// certificate chain
! int chainLen = 0;
Certificate[] certs = null;
if (entry instanceof PrivateKeyEntry) {
PrivateKeyEntry keyEntry = (PrivateKeyEntry) entry;
if (keyEntry.chain == null) {
*** 1654,1663 ****
--- 1654,1664 ----
}
certs = keyEntry.chain;
} else if (entry instanceof CertEntry) {
certs = new Certificate[]{((CertEntry) entry).cert};
+ chainLen = 1;
}
for (int i = 0; i < chainLen; i++) {
// create SafeBag of Type CertBag
DerOutputStream safeBag = new DerOutputStream();