All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bouncycastle.jce.spec.OpenSSHPrivateKeySpec Maven / Gradle / Ivy

Go to download

The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms. This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.4.

There is a newer version: 1.79
Show newest version
package org.bouncycastle.jce.spec;

/**
 * OpenSSHPrivateKeySpec holds and encoded OpenSSH private key.
 * The format of the key can be either ASN.1 or OpenSSH.
 * @deprecated use org.bouncycastle.jcajce.spec.OpenSSHPrivateKeySpec
 */
public class OpenSSHPrivateKeySpec
    extends org.bouncycastle.jcajce.spec.OpenSSHPrivateKeySpec
{
    /**
     * Accept an encoded key and determine the format.
     * 

* The encoded key should be the Base64 decoded blob between the "---BEGIN and ---END" markers. * This constructor will endeavour to find the OpenSSH format magic value. If it can not then it * will default to ASN.1. It does not attempt to validate the ASN.1 *

* Example: * OpenSSHPrivateKeySpec privSpec = new OpenSSHPrivateKeySpec(rawPriv); *

* KeyFactory kpf = KeyFactory.getInstance("RSA", "BC"); * PrivateKey prk = kpf.generatePrivate(privSpec); *

* OpenSSHPrivateKeySpec rcPrivateSpec = kpf.getKeySpec(prk, OpenSSHPrivateKeySpec.class); * * @param encodedKey The encoded key. */ public OpenSSHPrivateKeySpec(byte[] encodedKey) { super(encodedKey); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy