0N/A/*
2362N/A * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage sun.security.provider;
0N/A
0N/Aimport java.math.BigInteger;
0N/Aimport java.security.KeyRep;
0N/Aimport java.security.InvalidKeyException;
0N/A
0N/A/**
0N/A * An X.509 public key for the Digital Signature Algorithm.
0N/A *
0N/A * The difference between DSAPublicKeyImpl and DSAPublicKey is that
0N/A * DSAPublicKeyImpl calls writeReplace with KeyRep, and DSAPublicKey
0N/A * calls writeObject.
0N/A *
0N/A * See the comments in DSAKeyFactory, 4532506, and 6232513.
0N/A *
0N/A */
0N/A
0N/Apublic final class DSAPublicKeyImpl extends DSAPublicKey {
0N/A
0N/A private static final long serialVersionUID = 7819830118247182730L;
0N/A
0N/A /**
0N/A * Make a DSA public key out of a public key and three parameters.
0N/A * The p, q, and g parameters may be null, but if so, parameters will need
0N/A * to be supplied from some other source before this key can be used in
0N/A * cryptographic operations. PKIX RFC2459bis explicitly allows DSA public
0N/A * keys without parameters, where the parameters are provided in the
0N/A * issuer's DSA public key.
0N/A *
0N/A * @param y the actual key bits
0N/A * @param p DSA parameter p, may be null if all of p, q, and g are null.
0N/A * @param q DSA parameter q, may be null if all of p, q, and g are null.
0N/A * @param g DSA parameter g, may be null if all of p, q, and g are null.
0N/A */
0N/A public DSAPublicKeyImpl(BigInteger y, BigInteger p, BigInteger q,
0N/A BigInteger g)
0N/A throws InvalidKeyException {
0N/A super(y, p, q, g);
0N/A }
0N/A
0N/A /**
0N/A * Make a DSA public key from its DER encoding (X.509).
0N/A */
0N/A public DSAPublicKeyImpl(byte[] encoded) throws InvalidKeyException {
0N/A super(encoded);
0N/A }
0N/A
0N/A protected Object writeReplace() throws java.io.ObjectStreamException {
0N/A return new KeyRep(KeyRep.Type.PUBLIC,
0N/A getAlgorithm(),
0N/A getFormat(),
0N/A getEncoded());
0N/A }
0N/A}