public static class OpenSSHParser.OpenSSH
extends java.lang.Object
| Constructor and Description |
|---|
OpenSSH() |
| Modifier and Type | Method and Description |
|---|---|
static java.security.PublicKey |
decode4253PublicKey(byte[] bytes1) |
static byte[] |
encodeDsaPublicKey(java.security.interfaces.DSAPublicKey key)
Order determined by https://tools.ietf.org/html/rfc4253#section-6.6
The "ssh-dss" key format has the following specific encoding:
string "ssh-dss"
mpint p
mpint q
mpint g
mpint y
|
static byte[] |
encodeRsaPublicKey(java.security.interfaces.RSAPublicKey key) |
static void |
encodeUInt32(int value,
java.io.OutputStream out) |
static java.lang.String |
formatSshPublicKey(java.security.PublicKey publicKey,
java.lang.String comment) |
static int |
read(java.io.InputStream input,
byte[] buffer,
int offset,
int length)
Read as many bytes as possible until EOF or achieved required length
|
static java.math.BigInteger |
readBigInt(java.io.InputStream s) |
static void |
readFully(java.io.InputStream input,
byte[] buffer)
Read the requested number of bytes or fail if there are not enough left.
|
static void |
readFully(java.io.InputStream input,
byte[] buffer,
int offset,
int length)
Read the requested number of bytes or fail if there are not enough left.
|
static java.security.PublicKey |
readSshPublicKey(java.lang.String sshPublicKeyFileContents) |
static java.lang.String |
readString(java.io.InputStream s) |
public static java.lang.String formatSshPublicKey(java.security.PublicKey publicKey,
java.lang.String comment)
throws java.io.IOException
java.io.IOExceptionpublic static byte[] encodeRsaPublicKey(java.security.interfaces.RSAPublicKey key)
throws java.io.IOException
java.io.IOExceptionpublic static byte[] encodeDsaPublicKey(java.security.interfaces.DSAPublicKey key)
throws java.io.IOException
java.io.IOExceptionpublic static void encodeUInt32(int value,
java.io.OutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic static java.security.PublicKey readSshPublicKey(java.lang.String sshPublicKeyFileContents)
throws java.io.IOException,
java.security.GeneralSecurityException
java.io.IOExceptionjava.security.GeneralSecurityExceptionpublic static java.security.PublicKey decode4253PublicKey(byte[] bytes1)
throws java.io.IOException,
java.security.NoSuchAlgorithmException,
java.security.spec.InvalidKeySpecException
java.io.IOExceptionjava.security.NoSuchAlgorithmExceptionjava.security.spec.InvalidKeySpecExceptionpublic static java.math.BigInteger readBigInt(java.io.InputStream s)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String readString(java.io.InputStream s)
throws java.io.IOException
java.io.IOExceptionpublic static void readFully(java.io.InputStream input,
byte[] buffer)
throws java.io.IOException
input - where to read input frombuffer - destinationjava.io.IOException - if there is a problem reading the filejava.io.EOFException - if the number of bytes read was incorrectpublic static void readFully(java.io.InputStream input,
byte[] buffer,
int offset,
int length)
throws java.io.IOException
input - where to read input frombuffer - destinationoffset - initial offset into bufferlength - length to read, must be ≥ 0java.io.IOException - if there is a problem reading the filejava.io.EOFException - if the number of bytes read was incorrectpublic static int read(java.io.InputStream input,
byte[] buffer,
int offset,
int length)
throws java.io.IOException
input - where to read input frombuffer - destinationoffset - initial offset into bufferlength - length to read - ignored if non-positivejava.io.IOException - if a read error occursCopyright © 2014-2018 Tomitribe Corporation. All Rights Reserved.