public class SafeBag extends Object
| Constructor and Description |
|---|
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.
|
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. If the password is used to decrypt the
PKCS #8 EncryptedPrivateKeyInfo.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. If the password is used to decrypt the
PKCS #8 EncryptedPrivateKeyInfo.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. If the password is used to decrypt the
PKCS #8 EncryptedPrivateKeyInfo.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 final Data getCertificate()
public final Blob getPrivateKeyBag()
Copyright © 2018. All rights reserved.