-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRSAPublicKeySpec.java
More file actions
105 lines (93 loc) · 2.03 KB
/
Copy pathRSAPublicKeySpec.java
File metadata and controls
105 lines (93 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.security.spec;
import java.math.BigInteger;
/**
* This class specifies an RSA public key.
*
* @author Jan Luehe
*
*
* @see java.security.Key
* @see java.security.KeyFactory
* @see KeySpec
* @see X509EncodedKeySpec
* @see RSAPrivateKeySpec
* @see RSAPrivateCrtKeySpec
*/
public class RSAPublicKeySpec implements KeySpec {
private final BigInteger modulus;
private final BigInteger publicExponent;
private final AlgorithmParameterSpec params;
/**
* Creates a new RSAPublicKeySpec.
*
* @param modulus the modulus
* @param publicExponent the public exponent
*/
public RSAPublicKeySpec(BigInteger modulus, BigInteger publicExponent) {
this(modulus, publicExponent, null);
}
/**
* Creates a new RSAPublicKeySpec with additional key parameters.
*
* @param modulus the modulus
* @param publicExponent the public exponent
* @param params the parameters associated with this key, may be null
* @since 8
*/
public RSAPublicKeySpec(BigInteger modulus, BigInteger publicExponent,
AlgorithmParameterSpec params) {
this.modulus = modulus;
this.publicExponent = publicExponent;
this.params = params;
}
/**
* Returns the modulus.
*
* @return the modulus
*/
public BigInteger getModulus() {
return this.modulus;
}
/**
* Returns the public exponent.
*
* @return the public exponent
*/
public BigInteger getPublicExponent() {
return this.publicExponent;
}
/**
* Returns the parameters associated with this key, may be null if not
* present.
*
* @return the parameters associated with this key
* @since 8
*/
public AlgorithmParameterSpec getParams() {
return this.params;
}
}