src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKey.java
changeset 54639 2cac7d48db4c
parent 53007 e2798bf6318a
equal deleted inserted replaced
54638:9b8926bf85c1 54639:2cac7d48db4c
     1 /*
     1 /*
     2  * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    73 
    73 
    74     protected final int keyLength;
    74     protected final int keyLength;
    75 
    75 
    76     protected final String algorithm;
    76     protected final String algorithm;
    77 
    77 
    78     protected CKey(String algorithm, long hCryptProv, long hCryptKey, int keyLength) {
    78     protected CKey(String algorithm, NativeHandles handles, int keyLength) {
    79         this.algorithm = algorithm;
    79         this.algorithm = algorithm;
    80         this.handles = new NativeHandles(hCryptProv, hCryptKey);
    80         this.handles = handles;
    81         this.keyLength = keyLength;
    81         this.keyLength = keyLength;
    82     }
    82     }
    83 
    83 
    84     // Native method to cleanup the key handle.
    84     // Native method to cleanup the key handle.
    85     private native static void cleanUp(long hCryptProv, long hCryptKey);
    85     private native static void cleanUp(long hCryptProv, long hCryptKey);