/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* The handle for an RSA public key using the Microsoft Crypto API.
*
* @since 1.6
*/
{
/**
* Construct an RSAPublicKey object.
*/
{
}
/**
* Returns the standard algorithm name for this key. For
* example, "RSA" would indicate that this key is a RSA key.
* See Appendix A in the <a href=
* "../../../guide/security/CryptoSpec.html#AppA">
* Java Cryptography Architecture API Specification & Reference </a>
* for information about standard algorithm names.
*
* @return the name of the algorithm associated with this key.
*/
{
return "RSA";
}
/**
* Returns a printable description of the key.
*/
{
}
/**
* Returns the public exponent.
*/
try {
} catch (KeyException e) {
throw new ProviderException(e);
}
}
return exponent;
}
/**
* Returns the modulus.
*/
try {
} catch (KeyException e) {
throw new ProviderException(e);
}
}
return modulus;
}
/**
* Returns the name of the primary encoding format of this key,
* or null if this key does not support encoding.
* The primary encoding format is
* named in terms of the appropriate ASN.1 data format, if an
* ASN.1 specification for this key exists.
* For example, the name of the ASN.1 data format for public
* keys is <I>SubjectPublicKeyInfo</I>, as
* defined by the X.509 standard; in this case, the returned format is
* <code>"X.509"</code>. Similarly,
* the name of the ASN.1 data format for private keys is
* <I>PrivateKeyInfo</I>,
* as defined by the PKCS #8 standard; in this case, the returned format is
* <code>"PKCS#8"</code>.
*
* @return the primary encoding format of the key.
*/
{
return "X.509";
}
/**
* Returns the key in its primary encoding format, or null
* if this key does not support encoding.
*
* @return the encoded key, or null if the key does not support
* encoding.
*/
public byte[] getEncoded()
{
try {
getPublicExponent()).getEncoded();
} catch (KeyException e) {
// ignore
}
}
return encoding;
}
getAlgorithm(),
getFormat(),
getEncoded());
}
/*
* Returns the Microsoft CryptoAPI representation of the key.
*/
/*
* Returns the key's public exponent (in big-endian 2's complement format).
*/
/*
* Returns the key's modulus (in big-endian 2's complement format).
*/
}