/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* mac keys) from the master secret.
*
* @author Andreas Sterbenz
* @since 1.6
*/
+ "initialized using a TlsKeyMaterialParameterSpec";
// token instance
// algorithm name
// mechanism id
private long mechanism;
// parameter spec
// master secret as a P11Key
// version, e.g. 0x0301
private int version;
throws PKCS11Exception {
super();
}
throw new InvalidParameterException(MSG);
}
if (params instanceof TlsKeyMaterialParameterSpec == false) {
throw new InvalidAlgorithmParameterException(MSG);
}
try {
} catch (InvalidKeyException e) {
throw new InvalidAlgorithmParameterException("init() failed", e);
}
throw new InvalidAlgorithmParameterException
("Only SSL 3.0, TLS 1.0, and TLS 1.1 are supported");
}
// we assume the token supports both the CKM_SSL3_* and the CKM_TLS_*
// mechanisms
}
throw new InvalidParameterException(MSG);
}
throw new IllegalStateException
("TlsKeyMaterialGenerator must be initialized");
}
boolean isExportable;
if (expandedKeyBits != 0) {
isExportable = true;
} else {
isExportable = false;
}
if (keyType < 0) {
if (keyBits != 0) {
throw new ProviderException
} else {
// NULL encryption ciphersuites
}
}
try {
if (keyBits != 0) {
attributes = new CK_ATTRIBUTE[] {
};
} else {
// ciphersuites with NULL ciphers
}
// the returned keyID is a dummy, ignore
// Note that the MAC keys do not inherit all attributes from the
// template, but they do inherit the sensitive/extractable/token
// flags, which is all P11Key cares about.
if (keyBits != 0) {
} else {
}
} catch (Exception e) {
throw new ProviderException("Could not generate key", e);
} finally {
}
}
}