Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.base/share/classes/sun/security/provider/DSAPublicKeyImpl.java
41159 views
1
/*
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.
4
*
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
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
package sun.security.provider;
27
28
import java.math.BigInteger;
29
import java.security.KeyRep;
30
import java.security.InvalidKeyException;
31
32
/**
33
* An X.509 public key for the Digital Signature Algorithm.
34
*
35
* The difference between DSAPublicKeyImpl and DSAPublicKey is that
36
* DSAPublicKeyImpl calls writeReplace with KeyRep, and DSAPublicKey
37
* calls writeObject.
38
*
39
* See the comments in DSAKeyFactory, 4532506, and 6232513.
40
*
41
*/
42
43
public final class DSAPublicKeyImpl extends DSAPublicKey {
44
45
@java.io.Serial
46
private static final long serialVersionUID = 7819830118247182730L;
47
48
/**
49
* Make a DSA public key out of a public key and three parameters.
50
* The p, q, and g parameters may be null, but if so, parameters will need
51
* to be supplied from some other source before this key can be used in
52
* cryptographic operations. PKIX RFC2459bis explicitly allows DSA public
53
* keys without parameters, where the parameters are provided in the
54
* issuer's DSA public key.
55
*
56
* @param y the actual key bits
57
* @param p DSA parameter p, may be null if all of p, q, and g are null.
58
* @param q DSA parameter q, may be null if all of p, q, and g are null.
59
* @param g DSA parameter g, may be null if all of p, q, and g are null.
60
*/
61
public DSAPublicKeyImpl(BigInteger y, BigInteger p, BigInteger q,
62
BigInteger g)
63
throws InvalidKeyException {
64
super(y, p, q, g);
65
}
66
67
/**
68
* Make a DSA public key from its DER encoding (X.509).
69
*/
70
public DSAPublicKeyImpl(byte[] encoded) throws InvalidKeyException {
71
super(encoded);
72
}
73
74
@java.io.Serial
75
protected Object writeReplace() throws java.io.ObjectStreamException {
76
return new KeyRep(KeyRep.Type.PUBLIC,
77
getAlgorithm(),
78
getFormat(),
79
getEncoded());
80
}
81
}
82
83