< prev index next >

src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11Digest.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2003, 2012, 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) 2003, 2016, 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
*** 32,41 **** --- 32,43 ---- import javax.crypto.SecretKey; import sun.nio.ch.DirectBuffer; + import sun.security.util.MessageDigestSpi2; + import sun.security.pkcs11.wrapper.*; import static sun.security.pkcs11.wrapper.PKCS11Constants.*; /** * MessageDigest implementation class. This class currently supports
*** 47,57 **** * minimize number of the Java->native transitions. * * @author Andreas Sterbenz * @since 1.5 */ ! final class P11Digest extends MessageDigestSpi implements Cloneable { /* fields initialized, no session acquired */ private final static int S_BLANK = 1; /* data in buffer, session acquired, but digest not initialized */ --- 49,60 ---- * minimize number of the Java->native transitions. * * @author Andreas Sterbenz * @since 1.5 */ ! final class P11Digest extends MessageDigestSpi implements Cloneable, ! MessageDigestSpi2 { /* fields initialized, no session acquired */ private final static int S_BLANK = 1; /* data in buffer, session acquired, but digest not initialized */
*** 231,244 **** throw new ProviderException("update() failed", e); } } // Called by SunJSSE via reflection during the SSL 3.0 handshake if ! // the master secret is sensitive. We may want to consider making this ! // method public in a future release. ! protected void implUpdate(SecretKey key) throws InvalidKeyException { ! // SunJSSE calls this method only if the key does not have a RAW // encoding, i.e. if it is sensitive. Therefore, no point in calling // SecretKeyFactory to try to convert it. Just verify it ourselves. if (key instanceof P11Key == false) { throw new InvalidKeyException("Not a P11Key: " + key); --- 234,248 ---- throw new ProviderException("update() failed", e); } } // Called by SunJSSE via reflection during the SSL 3.0 handshake if ! // the master secret is sensitive. ! // Note: Change to protected after this method is moved from ! // sun.security.util.MessageSpi2 interface to ! // java.security.MessageDigestSpi class ! public void engineUpdate(SecretKey key) throws InvalidKeyException { // SunJSSE calls this method only if the key does not have a RAW // encoding, i.e. if it is sensitive. Therefore, no point in calling // SecretKeyFactory to try to convert it. Just verify it ourselves. if (key instanceof P11Key == false) { throw new InvalidKeyException("Not a P11Key: " + key);
< prev index next >