Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
929bef5e
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
929bef5e
编写于
4月 21, 2011
作者:
L
lana
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
9d8e3c57
a227af76
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
91 addition
and
43 deletion
+91
-43
src/share/classes/sun/security/ec/ECKeyPairGenerator.java
src/share/classes/sun/security/ec/ECKeyPairGenerator.java
+9
-8
src/windows/classes/sun/security/mscapi/KeyStore.java
src/windows/classes/sun/security/mscapi/KeyStore.java
+25
-12
src/windows/classes/sun/security/mscapi/RSACipher.java
src/windows/classes/sun/security/mscapi/RSACipher.java
+6
-1
src/windows/classes/sun/security/mscapi/RSAKeyPairGenerator.java
...dows/classes/sun/security/mscapi/RSAKeyPairGenerator.java
+13
-7
src/windows/classes/sun/security/mscapi/RSAPublicKey.java
src/windows/classes/sun/security/mscapi/RSAPublicKey.java
+21
-8
src/windows/classes/sun/security/mscapi/RSASignature.java
src/windows/classes/sun/security/mscapi/RSASignature.java
+12
-4
src/windows/native/sun/security/mscapi/security.cpp
src/windows/native/sun/security/mscapi/security.cpp
+5
-3
未找到文件。
src/share/classes/sun/security/ec/ECKeyPairGenerator.java
浏览文件 @
929bef5e
/*
/*
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009,
2011,
Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -121,15 +121,16 @@ public final class ECKeyPairGenerator extends KeyPairGeneratorSpi {
...
@@ -121,15 +121,16 @@ public final class ECKeyPairGenerator extends KeyPairGeneratorSpi {
}
}
random
.
nextBytes
(
seed
);
random
.
nextBytes
(
seed
);
try
{
long
[]
handles
=
generateECKeyPair
(
keySize
,
encodedParams
,
seed
);
long
[]
handles
=
generateECKeyPair
(
keySize
,
encodedParams
,
seed
);
// The 'params' object supplied above is equivalent to the native on
e
// The 'params' object supplied above is equivalent to the nativ
e
//
so there is no need to fetch it.
// one
so there is no need to fetch it.
// handles[0] points to the native private key
// handles[0] points to the native private key
BigInteger
s
=
new
BigInteger
(
1
,
getEncodedBytes
(
handles
[
0
]));
BigInteger
s
=
new
BigInteger
(
1
,
getEncodedBytes
(
handles
[
0
]));
try
{
PrivateKey
privateKey
=
PrivateKey
privateKey
=
new
ECPrivateKeyImpl
(
s
,
(
ECParameterSpec
)
params
);
new
ECPrivateKeyImpl
(
s
,
(
ECParameterSpec
)
params
);
...
@@ -163,7 +164,7 @@ public final class ECKeyPairGenerator extends KeyPairGeneratorSpi {
...
@@ -163,7 +164,7 @@ public final class ECKeyPairGenerator extends KeyPairGeneratorSpi {
* The first handle points to the private key, the second to the public key.
* The first handle points to the private key, the second to the public key.
*/
*/
private
static
native
long
[]
generateECKeyPair
(
int
keySize
,
private
static
native
long
[]
generateECKeyPair
(
int
keySize
,
byte
[]
encodedParams
,
byte
[]
seed
);
byte
[]
encodedParams
,
byte
[]
seed
)
throws
GeneralSecurityException
;
/*
/*
* Extracts the encoded key data using the supplied handle.
* Extracts the encoded key data using the supplied handle.
...
...
src/windows/classes/sun/security/mscapi/KeyStore.java
浏览文件 @
929bef5e
/*
/*
* Copyright (c) 2005, 20
06
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 20
11
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -31,6 +31,7 @@ import java.io.InputStream;
...
@@ -31,6 +31,7 @@ import java.io.InputStream;
import
java.io.OutputStream
;
import
java.io.OutputStream
;
import
java.math.BigInteger
;
import
java.math.BigInteger
;
import
java.security.AccessController
;
import
java.security.AccessController
;
import
java.security.InvalidKeyException
;
import
java.security.KeyStoreSpi
;
import
java.security.KeyStoreSpi
;
import
java.security.KeyStoreException
;
import
java.security.KeyStoreException
;
import
java.security.UnrecoverableKeyException
;
import
java.security.UnrecoverableKeyException
;
...
@@ -123,6 +124,7 @@ abstract class KeyStore extends KeyStoreSpi {
...
@@ -123,6 +124,7 @@ abstract class KeyStore extends KeyStoreSpi {
* Sets the private key for the keystore entry.
* Sets the private key for the keystore entry.
*/
*/
void
setPrivateKey
(
RSAPrivateCrtKey
key
)
void
setPrivateKey
(
RSAPrivateCrtKey
key
)
throws
InvalidKeyException
,
KeyStoreException
{
{
byte
[]
modulusBytes
=
key
.
getModulus
().
toByteArray
();
byte
[]
modulusBytes
=
key
.
getModulus
().
toByteArray
();
...
@@ -158,7 +160,7 @@ abstract class KeyStore extends KeyStoreSpi {
...
@@ -158,7 +160,7 @@ abstract class KeyStore extends KeyStoreSpi {
* Sets the certificate chain for the keystore entry.
* Sets the certificate chain for the keystore entry.
*/
*/
void
setCertificateChain
(
X509Certificate
[]
chain
)
void
setCertificateChain
(
X509Certificate
[]
chain
)
throws
CertificateException
throws
CertificateException
,
KeyStoreException
{
{
for
(
int
i
=
0
;
i
<
chain
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
chain
.
length
;
i
++)
{
byte
[]
encoding
=
chain
[
i
].
getEncoded
();
byte
[]
encoding
=
chain
[
i
].
getEncoded
();
...
@@ -404,13 +406,16 @@ abstract class KeyStore extends KeyStoreSpi {
...
@@ -404,13 +406,16 @@ abstract class KeyStore extends KeyStoreSpi {
}
}
entry
.
setAlias
(
alias
);
entry
.
setAlias
(
alias
);
entry
.
setPrivateKey
((
RSAPrivateCrtKey
)
key
);
try
{
try
{
entry
.
setPrivateKey
((
RSAPrivateCrtKey
)
key
);
entry
.
setCertificateChain
((
X509Certificate
[])
chain
);
entry
.
setCertificateChain
((
X509Certificate
[])
chain
);
}
catch
(
CertificateException
ce
)
{
}
catch
(
CertificateException
ce
)
{
throw
new
KeyStoreException
(
ce
);
throw
new
KeyStoreException
(
ce
);
}
catch
(
InvalidKeyException
ike
)
{
throw
new
KeyStoreException
(
ike
);
}
}
}
else
{
}
else
{
...
@@ -537,7 +542,7 @@ abstract class KeyStore extends KeyStoreSpi {
...
@@ -537,7 +542,7 @@ abstract class KeyStore extends KeyStoreSpi {
removeCertificate
(
getName
(),
alias
,
encoding
,
removeCertificate
(
getName
(),
alias
,
encoding
,
encoding
.
length
);
encoding
.
length
);
}
catch
(
CertificateE
ncodingE
xception
e
)
{
}
catch
(
CertificateException
e
)
{
throw
new
KeyStoreException
(
"Cannot remove entry: "
+
throw
new
KeyStoreException
(
"Cannot remove entry: "
+
e
);
e
);
}
}
...
@@ -754,8 +759,14 @@ abstract class KeyStore extends KeyStoreSpi {
...
@@ -754,8 +759,14 @@ abstract class KeyStore extends KeyStoreSpi {
// Clear all key entries
// Clear all key entries
entries
.
clear
();
entries
.
clear
();
try
{
// Load keys and/or certificate chains
// Load keys and/or certificate chains
loadKeysOrCertificateChains
(
getName
(),
entries
);
loadKeysOrCertificateChains
(
getName
(),
entries
);
}
catch
(
KeyStoreException
e
)
{
throw
new
IOException
(
e
);
}
}
}
/**
/**
...
@@ -868,7 +879,7 @@ abstract class KeyStore extends KeyStoreSpi {
...
@@ -868,7 +879,7 @@ abstract class KeyStore extends KeyStoreSpi {
* @param entries Collection of key/certificate.
* @param entries Collection of key/certificate.
*/
*/
private
native
void
loadKeysOrCertificateChains
(
String
name
,
private
native
void
loadKeysOrCertificateChains
(
String
name
,
Collection
<
KeyEntry
>
entries
);
Collection
<
KeyEntry
>
entries
)
throws
KeyStoreException
;
/**
/**
* Stores a DER-encoded certificate into the certificate store
* Stores a DER-encoded certificate into the certificate store
...
@@ -879,7 +890,7 @@ abstract class KeyStore extends KeyStoreSpi {
...
@@ -879,7 +890,7 @@ abstract class KeyStore extends KeyStoreSpi {
*/
*/
private
native
void
storeCertificate
(
String
name
,
String
alias
,
private
native
void
storeCertificate
(
String
name
,
String
alias
,
byte
[]
encoding
,
int
encodingLength
,
long
hCryptProvider
,
byte
[]
encoding
,
int
encodingLength
,
long
hCryptProvider
,
long
hCryptKey
);
long
hCryptKey
)
throws
CertificateException
,
KeyStoreException
;
/**
/**
* Removes the certificate from the certificate store
* Removes the certificate from the certificate store
...
@@ -889,14 +900,16 @@ abstract class KeyStore extends KeyStoreSpi {
...
@@ -889,14 +900,16 @@ abstract class KeyStore extends KeyStoreSpi {
* @param encoding DER-encoded certificate.
* @param encoding DER-encoded certificate.
*/
*/
private
native
void
removeCertificate
(
String
name
,
String
alias
,
private
native
void
removeCertificate
(
String
name
,
String
alias
,
byte
[]
encoding
,
int
encodingLength
);
byte
[]
encoding
,
int
encodingLength
)
throws
CertificateException
,
KeyStoreException
;
/**
/**
* Destroys the key container.
* Destroys the key container.
*
*
* @param keyContainerName The name of the key container.
* @param keyContainerName The name of the key container.
*/
*/
private
native
void
destroyKeyContainer
(
String
keyContainerName
);
private
native
void
destroyKeyContainer
(
String
keyContainerName
)
throws
KeyStoreException
;
/**
/**
* Generates a private-key BLOB from a key's components.
* Generates a private-key BLOB from a key's components.
...
@@ -910,8 +923,8 @@ abstract class KeyStore extends KeyStoreSpi {
...
@@ -910,8 +923,8 @@ abstract class KeyStore extends KeyStoreSpi {
byte
[]
primeQ
,
byte
[]
primeQ
,
byte
[]
exponentP
,
byte
[]
exponentP
,
byte
[]
exponentQ
,
byte
[]
exponentQ
,
byte
[]
crtCoefficient
);
byte
[]
crtCoefficient
)
throws
InvalidKeyException
;
private
native
RSAPrivateKey
storePrivateKey
(
byte
[]
keyBlob
,
private
native
RSAPrivateKey
storePrivateKey
(
byte
[]
keyBlob
,
String
keyContainerName
,
int
keySize
);
String
keyContainerName
,
int
keySize
)
throws
KeyStoreException
;
}
}
src/windows/classes/sun/security/mscapi/RSACipher.java
浏览文件 @
929bef5e
...
@@ -219,8 +219,13 @@ public final class RSACipher extends CipherSpi {
...
@@ -219,8 +219,13 @@ public final class RSACipher extends CipherSpi {
byte
[]
keyBlob
=
RSASignature
.
generatePublicKeyBlob
(
byte
[]
keyBlob
=
RSASignature
.
generatePublicKeyBlob
(
keyBitLength
,
modulusBytes
,
exponentBytes
);
keyBitLength
,
modulusBytes
,
exponentBytes
);
try
{
key
=
RSASignature
.
importPublicKey
(
keyBlob
,
keyBitLength
);
key
=
RSASignature
.
importPublicKey
(
keyBlob
,
keyBitLength
);
}
catch
(
KeyStoreException
e
)
{
throw
new
InvalidKeyException
(
e
);
}
}
else
{
}
else
{
throw
new
InvalidKeyException
(
"Unsupported key type: "
+
key
);
throw
new
InvalidKeyException
(
"Unsupported key type: "
+
key
);
}
}
...
...
src/windows/classes/sun/security/mscapi/RSAKeyPairGenerator.java
浏览文件 @
929bef5e
/*
/*
* Copyright (c) 2005, 20
08
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 20
11
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -105,14 +105,20 @@ public final class RSAKeyPairGenerator extends KeyPairGeneratorSpi {
...
@@ -105,14 +105,20 @@ public final class RSAKeyPairGenerator extends KeyPairGeneratorSpi {
// generate the keypair. See JCA doc
// generate the keypair. See JCA doc
public
KeyPair
generateKeyPair
()
{
public
KeyPair
generateKeyPair
()
{
try
{
// Generate each keypair in a unique key container
// Generate each keypair in a unique key container
RSAKeyPair
keys
=
RSAKeyPair
keys
=
generateRSAKeyPair
(
keySize
,
generateRSAKeyPair
(
keySize
,
"{"
+
UUID
.
randomUUID
().
toString
()
+
"}"
);
"{"
+
UUID
.
randomUUID
().
toString
()
+
"}"
);
return
new
KeyPair
(
keys
.
getPublic
(),
keys
.
getPrivate
());
return
new
KeyPair
(
keys
.
getPublic
(),
keys
.
getPrivate
());
}
catch
(
KeyException
e
)
{
throw
new
ProviderException
(
e
);
}
}
}
private
static
native
RSAKeyPair
generateRSAKeyPair
(
int
keySize
,
private
static
native
RSAKeyPair
generateRSAKeyPair
(
int
keySize
,
String
keyContainerName
);
String
keyContainerName
)
throws
KeyException
;
}
}
src/windows/classes/sun/security/mscapi/RSAPublicKey.java
浏览文件 @
929bef5e
...
@@ -27,7 +27,9 @@ package sun.security.mscapi;
...
@@ -27,7 +27,9 @@ package sun.security.mscapi;
import
java.math.BigInteger
;
import
java.math.BigInteger
;
import
java.security.InvalidKeyException
;
import
java.security.InvalidKeyException
;
import
java.security.KeyException
;
import
java.security.KeyRep
;
import
java.security.KeyRep
;
import
java.security.ProviderException
;
import
java.security.PublicKey
;
import
java.security.PublicKey
;
import
sun.security.rsa.RSAPublicKeyImpl
;
import
sun.security.rsa.RSAPublicKeyImpl
;
...
@@ -89,9 +91,14 @@ class RSAPublicKey extends Key implements java.security.interfaces.RSAPublicKey
...
@@ -89,9 +91,14 @@ class RSAPublicKey extends Key implements java.security.interfaces.RSAPublicKey
public
BigInteger
getPublicExponent
()
{
public
BigInteger
getPublicExponent
()
{
if
(
exponent
==
null
)
{
if
(
exponent
==
null
)
{
publicKeyBlob
=
getPublicKeyBlob
(
hCryptKey
);
try
{
publicKeyBlob
=
getPublicKeyBlob
(
hCryptKey
);
exponent
=
new
BigInteger
(
1
,
getExponent
(
publicKeyBlob
));
exponent
=
new
BigInteger
(
1
,
getExponent
(
publicKeyBlob
));
}
catch
(
KeyException
e
)
{
throw
new
ProviderException
(
e
);
}
}
}
return
exponent
;
return
exponent
;
...
@@ -103,8 +110,14 @@ class RSAPublicKey extends Key implements java.security.interfaces.RSAPublicKey
...
@@ -103,8 +110,14 @@ class RSAPublicKey extends Key implements java.security.interfaces.RSAPublicKey
public
BigInteger
getModulus
()
{
public
BigInteger
getModulus
()
{
if
(
modulus
==
null
)
{
if
(
modulus
==
null
)
{
try
{
publicKeyBlob
=
getPublicKeyBlob
(
hCryptKey
);
publicKeyBlob
=
getPublicKeyBlob
(
hCryptKey
);
modulus
=
new
BigInteger
(
1
,
getModulus
(
publicKeyBlob
));
modulus
=
new
BigInteger
(
1
,
getModulus
(
publicKeyBlob
));
}
catch
(
KeyException
e
)
{
throw
new
ProviderException
(
e
);
}
}
}
return
modulus
;
return
modulus
;
...
@@ -147,7 +160,7 @@ class RSAPublicKey extends Key implements java.security.interfaces.RSAPublicKey
...
@@ -147,7 +160,7 @@ class RSAPublicKey extends Key implements java.security.interfaces.RSAPublicKey
encoding
=
new
RSAPublicKeyImpl
(
getModulus
(),
encoding
=
new
RSAPublicKeyImpl
(
getModulus
(),
getPublicExponent
()).
getEncoded
();
getPublicExponent
()).
getEncoded
();
}
catch
(
Invalid
KeyException
e
)
{
}
catch
(
KeyException
e
)
{
// ignore
// ignore
}
}
}
}
...
@@ -164,15 +177,15 @@ class RSAPublicKey extends Key implements java.security.interfaces.RSAPublicKey
...
@@ -164,15 +177,15 @@ class RSAPublicKey extends Key implements java.security.interfaces.RSAPublicKey
/*
/*
* Returns the Microsoft CryptoAPI representation of the key.
* Returns the Microsoft CryptoAPI representation of the key.
*/
*/
private
native
byte
[]
getPublicKeyBlob
(
long
hCryptKey
);
private
native
byte
[]
getPublicKeyBlob
(
long
hCryptKey
)
throws
KeyException
;
/*
/*
* Returns the key's public exponent (in big-endian 2's complement format).
* Returns the key's public exponent (in big-endian 2's complement format).
*/
*/
private
native
byte
[]
getExponent
(
byte
[]
keyBlob
);
private
native
byte
[]
getExponent
(
byte
[]
keyBlob
)
throws
KeyException
;
/*
/*
* Returns the key's modulus (in big-endian 2's complement format).
* Returns the key's modulus (in big-endian 2's complement format).
*/
*/
private
native
byte
[]
getModulus
(
byte
[]
keyBlob
);
private
native
byte
[]
getModulus
(
byte
[]
keyBlob
)
throws
KeyException
;
}
}
src/windows/classes/sun/security/mscapi/RSASignature.java
浏览文件 @
929bef5e
/*
/*
* Copyright (c) 2005, 20
08
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 20
11
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -31,6 +31,7 @@ import java.security.PrivateKey;
...
@@ -31,6 +31,7 @@ import java.security.PrivateKey;
import
java.security.InvalidKeyException
;
import
java.security.InvalidKeyException
;
import
java.security.InvalidParameterException
;
import
java.security.InvalidParameterException
;
import
java.security.InvalidAlgorithmParameterException
;
import
java.security.InvalidAlgorithmParameterException
;
import
java.security.KeyStoreException
;
import
java.security.NoSuchAlgorithmException
;
import
java.security.NoSuchAlgorithmException
;
import
java.security.ProviderException
;
import
java.security.ProviderException
;
import
java.security.MessageDigest
;
import
java.security.MessageDigest
;
...
@@ -146,8 +147,13 @@ abstract class RSASignature extends java.security.SignatureSpi
...
@@ -146,8 +147,13 @@ abstract class RSASignature extends java.security.SignatureSpi
byte
[]
keyBlob
=
generatePublicKeyBlob
(
byte
[]
keyBlob
=
generatePublicKeyBlob
(
keyBitLength
,
modulusBytes
,
exponentBytes
);
keyBitLength
,
modulusBytes
,
exponentBytes
);
try
{
publicKey
=
importPublicKey
(
keyBlob
,
keyBitLength
);
publicKey
=
importPublicKey
(
keyBlob
,
keyBitLength
);
}
catch
(
KeyStoreException
e
)
{
throw
new
InvalidKeyException
(
e
);
}
}
else
{
}
else
{
publicKey
=
(
sun
.
security
.
mscapi
.
RSAPublicKey
)
key
;
publicKey
=
(
sun
.
security
.
mscapi
.
RSAPublicKey
)
key
;
}
}
...
@@ -381,11 +387,13 @@ abstract class RSASignature extends java.security.SignatureSpi
...
@@ -381,11 +387,13 @@ abstract class RSASignature extends java.security.SignatureSpi
*/
*/
// used by RSACipher
// used by RSACipher
static
native
byte
[]
generatePublicKeyBlob
(
static
native
byte
[]
generatePublicKeyBlob
(
int
keyBitLength
,
byte
[]
modulus
,
byte
[]
publicExponent
);
int
keyBitLength
,
byte
[]
modulus
,
byte
[]
publicExponent
)
throws
InvalidKeyException
;
/**
/**
* Imports a public-key BLOB.
* Imports a public-key BLOB.
*/
*/
// used by RSACipher
// used by RSACipher
static
native
RSAPublicKey
importPublicKey
(
byte
[]
keyBlob
,
int
keySize
);
static
native
RSAPublicKey
importPublicKey
(
byte
[]
keyBlob
,
int
keySize
)
throws
KeyStoreException
;
}
}
src/windows/native/sun/security/mscapi/security.cpp
浏览文件 @
929bef5e
/*
/*
* Copyright (c) 2005, 20
06
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 20
11
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -40,6 +40,8 @@
...
@@ -40,6 +40,8 @@
#define CERTIFICATE_PARSING_EXCEPTION \
#define CERTIFICATE_PARSING_EXCEPTION \
"java/security/cert/CertificateParsingException"
"java/security/cert/CertificateParsingException"
#define INVALID_KEY_EXCEPTION \
"java/security/InvalidKeyException"
#define KEY_EXCEPTION "java/security/KeyException"
#define KEY_EXCEPTION "java/security/KeyException"
#define KEYSTORE_EXCEPTION "java/security/KeyStoreException"
#define KEYSTORE_EXCEPTION "java/security/KeyStoreException"
#define PROVIDER_EXCEPTION "java/security/ProviderException"
#define PROVIDER_EXCEPTION "java/security/ProviderException"
...
@@ -1398,7 +1400,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_RSAPublicKey_getPublicKeyB
...
@@ -1398,7 +1400,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_RSAPublicKey_getPublicKeyB
jbyteArray
blob
=
NULL
;
jbyteArray
blob
=
NULL
;
DWORD
dwBlobLen
;
DWORD
dwBlobLen
;
BYTE
*
pbKeyBlob
;
BYTE
*
pbKeyBlob
=
NULL
;
__try
__try
{
{
...
@@ -1656,7 +1658,7 @@ jbyteArray generateKeyBlob(
...
@@ -1656,7 +1658,7 @@ jbyteArray generateKeyBlob(
// Sanity check
// Sanity check
jsize
jPublicExponentLength
=
env
->
GetArrayLength
(
jPublicExponent
);
jsize
jPublicExponentLength
=
env
->
GetArrayLength
(
jPublicExponent
);
if
(
jPublicExponentLength
>
sizeof
(
pRsaPubKey
->
pubexp
))
{
if
(
jPublicExponentLength
>
sizeof
(
pRsaPubKey
->
pubexp
))
{
ThrowException
(
env
,
KEY_EXCEPTION
,
NTE_BAD_TYPE
);
ThrowException
(
env
,
INVALID_
KEY_EXCEPTION
,
NTE_BAD_TYPE
);
__leave
;
__leave
;
}
}
// The length argument must be the smaller of jPublicExponentLength
// The length argument must be the smaller of jPublicExponentLength
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录