public class SafeBag extends Object
| Constructor and Description |
|---|
SafeBag(Blob input)
Create a SafeBag by decoding the input as an NDN-TLV SafeBag.
|
SafeBag(ByteBuffer input)
Create a SafeBag by decoding the input as an NDN-TLV SafeBag.
|
SafeBag(Data certificate,
Blob privateKeyBag)
Create a SafeBag with the given certificate and private key.
|
SafeBag(Name keyName,
Blob privateKeyBag,
Blob publicKeyEncoding)
Create a SafeBag with given private key and a new self-signed certificate
for the given public key, using DigestAlgorithm.SHA256 to sign it.
|
SafeBag(Name keyName,
Blob privateKeyBag,
Blob publicKeyEncoding,
ByteBuffer password)
Create a SafeBag with given private key and a new self-signed certificate
for the given public key, using DigestAlgorithm.SHA256 to sign it.
|
SafeBag(Name keyName,
Blob privateKeyBag,
Blob publicKeyEncoding,
ByteBuffer password,
DigestAlgorithm digestAlgorithm)
Create a SafeBag with given private key and a new self-signed certificate
for the given public key.
|
SafeBag(Name keyName,
Blob privateKeyBag,
Blob publicKeyEncoding,
ByteBuffer password,
DigestAlgorithm digestAlgorithm,
WireFormat wireFormat)
Create a SafeBag with given private key and a new self-signed certificate
for the given public key.
|
| Modifier and Type | Method and Description |
|---|---|
Data |
getCertificate()
Get the certificate data packet.
|
Blob |
getPrivateKeyBag()
Get the encoded private key.
|
void |
wireDecode(Blob input)
Decode the input as an NDN-TLV SafeBag and update this object.
|
void |
wireDecode(ByteBuffer input)
Decode the input as an NDN-TLV SafeBag and update this object.
|
Blob |
wireEncode()
Encode this as an NDN-TLV SafeBag.
|
public SafeBag(Data certificate, Blob privateKeyBag)
certificate - The certificate data packet. This copies the object.privateKeyBag - The encoded private key. If encrypted, this is a
PKCS #8 EncryptedPrivateKeyInfo. If not encrypted, this is an unencrypted
PKCS #8 PrivateKeyInfo.public SafeBag(Name keyName, Blob privateKeyBag, Blob publicKeyEncoding, ByteBuffer password, DigestAlgorithm digestAlgorithm, WireFormat wireFormat) throws TpmBackEnd.Error, Pib.Error
keyName - The name of the public key. The certificate name will be
{keyName}/self/{version} where the version is based on the current time.
This copies the Name.privateKeyBag - The encoded private key. If encrypted, this is a
PKCS #8 EncryptedPrivateKeyInfo. If not encrypted, this is an unencrypted
PKCS #8 PrivateKeyInfo.publicKeyEncoding - The encoded public key for the certificate.password - The password for decrypting the private key in order to
sign the self-signed certificate, which should have characters in the range
of 1 to 127. If the password is supplied, use it to decrypt the PKCS #8
EncryptedPrivateKeyInfo. If the password is null, privateKeyBag is an
unencrypted PKCS #8 PrivateKeyInfo.digestAlgorithm - The digest algorithm for signing the self-signed
certificate.wireFormat - A WireFormat object used to encode the self-signed
certificate in order to sign it.TpmBackEnd.ErrorPib.Errorpublic SafeBag(Name keyName, Blob privateKeyBag, Blob publicKeyEncoding, ByteBuffer password, DigestAlgorithm digestAlgorithm) throws TpmBackEnd.Error, Pib.Error
keyName - The name of the public key. The certificate name will be
{keyName}/self/{version} where the version is based on the current time.
This copies the Name.privateKeyBag - The encoded private key. If encrypted, this is a
PKCS #8 EncryptedPrivateKeyInfo. If not encrypted, this is an unencrypted
PKCS #8 PrivateKeyInfo.publicKeyEncoding - The encoded public key for the certificate.password - The password for decrypting the private key in order to
sign the self-signed certificate, which should have characters in the range
of 1 to 127. If the password is supplied, use it to decrypt the PKCS #8
EncryptedPrivateKeyInfo. If the password is null, privateKeyBag is an
unencrypted PKCS #8 PrivateKeyInfo.digestAlgorithm - The digest algorithm for signing the self-signed
certificate.TpmBackEnd.ErrorPib.Errorpublic SafeBag(Name keyName, Blob privateKeyBag, Blob publicKeyEncoding, ByteBuffer password) throws TpmBackEnd.Error, Pib.Error
keyName - The name of the public key. The certificate name will be
{keyName}/self/{version} where the version is based on the current time.
This copies the Name.privateKeyBag - The encoded private key. If encrypted, this is a
PKCS #8 EncryptedPrivateKeyInfo. If not encrypted, this is an unencrypted
PKCS #8 PrivateKeyInfo.publicKeyEncoding - The encoded public key for the certificate.password - The password for decrypting the private key in order to
sign the self-signed certificate, which should have characters in the range
of 1 to 127. If the password is supplied, use it to decrypt the PKCS #8
EncryptedPrivateKeyInfo. If the password is null, privateKeyBag is an
unencrypted PKCS #8 PrivateKeyInfo.TpmBackEnd.ErrorPib.Errorpublic SafeBag(Name keyName, Blob privateKeyBag, Blob publicKeyEncoding) throws TpmBackEnd.Error, Pib.Error
keyName - The name of the public key. The certificate name will be
{keyName}/self/{version} where the version is based on the current time.
This copies the Name.privateKeyBag - The encoded private key, as an unencrypted PKCS #8
PrivateKeyInfo.publicKeyEncoding - The encoded public key for the certificate.TpmBackEnd.ErrorPib.Errorpublic SafeBag(ByteBuffer input) throws EncodingException
input - The input buffer to decode. This reads from position() to
limit(), but does not change the position.EncodingException - For invalid encoding.public SafeBag(Blob input) throws EncodingException
input - The input buffer to decode. This reads from position() to
limit(), but does not change the position.EncodingException - For invalid encoding.public final Data getCertificate()
public final Blob getPrivateKeyBag()
public final void wireDecode(ByteBuffer input) throws EncodingException
input - The input buffer to decode. This reads from position() to
limit(), but does not change the position.EncodingException - For invalid encoding.public final void wireDecode(Blob input) throws EncodingException
input - The input buffer to decode. This reads from position() to
limit(), but does not change the position.EncodingException - For invalid encoding.public final Blob wireEncode()
Copyright © 2019. All rights reserved.