Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 11 jdk.crypto.cryptoki.jmod - Crypto KI Module
JDK 11 jdk.crypto.cryptoki.jmod is the JMOD file for JDK 11 Crypto Cryptoki module.
JDK 11 Crypto KI module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.crypto.cryptoki.jmod.
JDK 11 Crypto KI module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Crypto KI module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.crypto.cryptoki.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ sun/security/pkcs11/P11TlsPrfGenerator.java
/* * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package sun.security.pkcs11; import java.security.*; import java.security.spec.AlgorithmParameterSpec; import javax.crypto.*; import javax.crypto.spec.*; import sun.security.internal.spec.TlsPrfParameterSpec; import static sun.security.pkcs11.TemplateManager.*; import sun.security.pkcs11.wrapper.*; import static sun.security.pkcs11.wrapper.PKCS11Constants.*; /** * KeyGenerator for the TLS PRF. Note that although the PRF is used in a number * of places during the handshake, this class is usually only used to calculate * the Finished messages. The reason is that for those other uses more specific * PKCS#11 mechanisms have been defined (CKM_SSL3_MASTER_KEY_DERIVE, etc.). * * <p>This class supports the CKM_TLS_PRF mechanism from PKCS#11 v2.20 and * the older NSS private mechanism. * * @author Andreas Sterbenz * @since 1.6 */ final class P11TlsPrfGenerator extends KeyGeneratorSpi { private final static String MSG = "TlsPrfGenerator must be initialized using a TlsPrfParameterSpec"; // token instance private final Token token; // algorithm name private final String algorithm; // mechanism id private final long mechanism; @SuppressWarnings("deprecation") private TlsPrfParameterSpec spec; private P11Key p11Key; P11TlsPrfGenerator(Token token, String algorithm, long mechanism) throws PKCS11Exception { super(); this.token = token; this.algorithm = algorithm; this.mechanism = mechanism; } protected void engineInit(SecureRandom random) { throw new InvalidParameterException(MSG); } @SuppressWarnings("deprecation") protected void engineInit(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException { if (params instanceof TlsPrfParameterSpec == false) { throw new InvalidAlgorithmParameterException(MSG); } this.spec = (TlsPrfParameterSpec)params; SecretKey key = spec.getSecret(); if (key == null) { key = NULL_KEY; } try { p11Key = P11SecretKeyFactory.convertKey(token, key, null); } catch (InvalidKeyException e) { throw new InvalidAlgorithmParameterException("init() failed", e); } } // SecretKeySpec does not allow zero length keys, so we define our // own class. // // As an anonymous class cannot make any guarantees about serialization // compatibility, it is nonsensical for an anonymous class to define a // serialVersionUID. Suppress warnings relative to missing serialVersionUID // field in the anonymous subclass of serializable SecretKey. @SuppressWarnings("serial") private static final SecretKey NULL_KEY = new SecretKey() { public byte[] getEncoded() { return new byte[0]; } public String getFormat() { return "RAW"; } public String getAlgorithm() { return "Generic"; } }; protected void engineInit(int keysize, SecureRandom random) { throw new InvalidParameterException(MSG); } protected SecretKey engineGenerateKey() { if (spec == null) { throw new IllegalStateException("TlsPrfGenerator must be initialized"); } byte[] label = P11Util.getBytesUTF8(spec.getLabel()); byte[] seed = spec.getSeed(); if (mechanism == CKM_NSS_TLS_PRF_GENERAL) { Session session = null; try { session = token.getOpSession(); token.p11.C_SignInit (session.id(), new CK_MECHANISM(mechanism), p11Key.keyID); token.p11.C_SignUpdate(session.id(), 0, label, 0, label.length); token.p11.C_SignUpdate(session.id(), 0, seed, 0, seed.length); byte[] out = token.p11.C_SignFinal (session.id(), spec.getOutputLength()); return new SecretKeySpec(out, "TlsPrf"); } catch (PKCS11Exception e) { throw new ProviderException("Could not calculate PRF", e); } finally { token.releaseSession(session); } } // mechanism == CKM_TLS_PRF byte[] out = new byte[spec.getOutputLength()]; CK_TLS_PRF_PARAMS params = new CK_TLS_PRF_PARAMS(seed, label, out); Session session = null; try { session = token.getOpSession(); long keyID = token.p11.C_DeriveKey(session.id(), new CK_MECHANISM(mechanism, params), p11Key.keyID, null); // ignore keyID, returned PRF bytes are in 'out' return new SecretKeySpec(out, "TlsPrf"); } catch (PKCS11Exception e) { throw new ProviderException("Could not calculate PRF", e); } finally { token.releaseSession(session); } } }
⏎ sun/security/pkcs11/P11TlsPrfGenerator.java
Or download all of them as a single archive file:
File name: jdk.crypto.cryptoki-11.0.1-src.zip File size: 204753 bytes Release date: 2018-11-04 Download
⇒ JDK 11 jdk.crypto.ec.jmod - Crypto EC Module
2020-08-13, 33577👍, 0💬
Popular Posts:
If you are a Java developer, it is very often that you need to use some 3rd party libraries to perfo...
JDK 11 java.compiler.jmod is the JMOD file for JDK 11 Compiler module. JDK 11 Compiler module compil...
What is the sax\Counter.java provided in the Apache Xerces package? I have Apache Xerces 2.11.0 inst...
SLF4J API is a simple API that allows to plug in any desired logging library at deployment time. Her...
JDK 17 java.desktop.jmod is the JMOD file for JDK 17 Desktop module. JDK 17 Desktop module compiled ...