Class PKCS8PrivateKeyInfo
- java.lang.Object
-
- org.apache.sshd.common.config.keys.loader.pem.PKCS8PrivateKeyInfo
-
public class PKCS8PrivateKeyInfo extends java.lang.Object
PrivateKeyInfo ::= SEQUENCE { version Version, privateKeyAlgorithm PrivateKeyAlgorithmIdentifier, privateKey PrivateKey, attributes [0] IMPLICIT Attributes OPTIONAL } Version ::= INTEGER PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier PrivateKey ::= OCTET STRING Attributes ::= SET OF Attribute AlgorithmIdentifier ::= SEQUENCE { algorithm OBJECT IDENTIFIER, parameters ANY DEFINED BY algorithm OPTIONAL }
- See Also:
- RFC 5208 - section 5
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.Integer>
algorithmIdentifier
private ASN1Object
algorithmParameter
private ASN1Object
privateKeyBytes
private java.math.BigInteger
version
-
Constructor Summary
Constructors Constructor Description PKCS8PrivateKeyInfo()
PKCS8PrivateKeyInfo(byte[] encBytes)
PKCS8PrivateKeyInfo(ASN1Object privateKeyInfo)
PKCS8PrivateKeyInfo(DERParser parser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
void
decode(byte[] encBytes)
void
decode(ASN1Object privateKeyInfo)
Decodes the current information with the data from the provided encoding.void
decode(DERParser parser)
java.util.List<java.lang.Integer>
getAlgorithmIdentifier()
ASN1Object
getAlgorithmParameter()
ASN1Object
getPrivateKeyBytes()
java.math.BigInteger
getVersion()
void
setAlgorithmIdentifier(java.util.List<java.lang.Integer> algorithmIdentifier)
void
setAlgorithmParameter(ASN1Object algorithmParameter)
void
setPrivateKeyBytes(ASN1Object privateKeyBytes)
void
setVersion(java.math.BigInteger version)
java.lang.String
toString()
-
-
-
Field Detail
-
version
private java.math.BigInteger version
-
algorithmIdentifier
private java.util.List<java.lang.Integer> algorithmIdentifier
-
algorithmParameter
private ASN1Object algorithmParameter
-
privateKeyBytes
private ASN1Object privateKeyBytes
-
-
Constructor Detail
-
PKCS8PrivateKeyInfo
public PKCS8PrivateKeyInfo()
-
PKCS8PrivateKeyInfo
public PKCS8PrivateKeyInfo(byte[] encBytes) throws java.io.IOException
- Throws:
java.io.IOException
-
PKCS8PrivateKeyInfo
public PKCS8PrivateKeyInfo(DERParser parser) throws java.io.IOException
- Throws:
java.io.IOException
-
PKCS8PrivateKeyInfo
public PKCS8PrivateKeyInfo(ASN1Object privateKeyInfo) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getVersion
public java.math.BigInteger getVersion()
-
setVersion
public void setVersion(java.math.BigInteger version)
-
getAlgorithmIdentifier
public java.util.List<java.lang.Integer> getAlgorithmIdentifier()
-
setAlgorithmIdentifier
public void setAlgorithmIdentifier(java.util.List<java.lang.Integer> algorithmIdentifier)
-
getAlgorithmParameter
public ASN1Object getAlgorithmParameter()
-
setAlgorithmParameter
public void setAlgorithmParameter(ASN1Object algorithmParameter)
-
getPrivateKeyBytes
public ASN1Object getPrivateKeyBytes()
-
setPrivateKeyBytes
public void setPrivateKeyBytes(ASN1Object privateKeyBytes)
-
decode
public void decode(byte[] encBytes) throws java.io.IOException
- Throws:
java.io.IOException
-
decode
public void decode(DERParser parser) throws java.io.IOException
- Throws:
java.io.IOException
-
decode
public void decode(ASN1Object privateKeyInfo) throws java.io.IOException
Decodes the current information with the data from the provided encoding. Note: User shouldclear()
the current information before parsing- Parameters:
privateKeyInfo
- TheASN1Object
encoding- Throws:
java.io.IOException
- If failed to parse the encoding
-
clear
public void clear()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-