jdk/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/RSAKeyPair.java
changeset 40389 c6df8bba0b71
parent 25859 3317bb8137f4
equal deleted inserted replaced
40320:2e83d21d78cd 40389:c6df8bba0b71
     1 /*
     1 /*
     2  * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2016, 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
    39     /**
    39     /**
    40      * Construct an RSAKeyPair object.
    40      * Construct an RSAKeyPair object.
    41      */
    41      */
    42     RSAKeyPair(long hCryptProv, long hCryptKey, int keyLength)
    42     RSAKeyPair(long hCryptProv, long hCryptKey, int keyLength)
    43     {
    43     {
    44         privateKey = new RSAPrivateKey(hCryptProv, hCryptKey, keyLength);
    44         Key.NativeHandles handles = new Key.NativeHandles(hCryptProv, hCryptKey);
    45         publicKey = new RSAPublicKey(hCryptProv, hCryptKey, keyLength);
    45         privateKey = new RSAPrivateKey(handles, keyLength);
       
    46         publicKey = new RSAPublicKey(handles, keyLength);
    46     }
    47     }
    47 
    48 
    48     public RSAPrivateKey getPrivate() {
    49     public RSAPrivateKey getPrivate() {
    49         return privateKey;
    50         return privateKey;
    50     }
    51     }