public class PibKey extends Object
| Constructor and Description |
|---|
PibKey(PibKeyImpl impl)
Create a PibKey which uses the impl backend implementation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCertificate_(CertificateV2 certificate)
Add the certificate.
|
static Name |
constructKeyName(Name identityName,
Name.Component keyId)
Construct a key name based on the appropriate naming conventions.
|
static Name |
extractIdentityFromKeyName(Name keyName)
Extract the identity namespace from keyName.
|
CertificateV2 |
getCertificate(Name certificateName)
Get the certificate with name certificateName.
|
PibCertificateContainer |
getCertificates_()
Get the PibCertificateContainer in the PibKeyImpl.
|
CertificateV2 |
getDefaultCertificate()
Get the default certificate for this Key.
|
Name |
getIdentityName()
Get the name of the identity this key belongs to.
|
KeyType |
getKeyType()
Get the key type.
|
Name |
getName() |
Blob |
getPublicKey()
Get the public key encoding.
|
static boolean |
isValidKeyName(Name keyName)
Check if keyName follows the naming conventions for a key name.
|
void |
removeCertificate_(Name certificateName)
Remove the certificate with name certificateName.
|
CertificateV2 |
setDefaultCertificate_(CertificateV2 certificate)
Add the certificate and set it as the default certificate of the key.
|
CertificateV2 |
setDefaultCertificate_(Name certificateName)
Set the existing certificate with name certificateName as the default
certificate.
|
public PibKey(PibKeyImpl impl)
public final Name getName()
public final Name getIdentityName()
AssertionError - if the backend implementation instance is invalid.public final KeyType getKeyType()
AssertionError - if the backend implementation instance is invalid.public final Blob getPublicKey()
AssertionError - if the backend implementation instance is invalid.public final CertificateV2 getCertificate(Name certificateName) throws Pib.Error, PibImpl.Error
certificateName - The name of the certificate.AssertionError - if certificateName does not match the key name, or
if the backend implementation instance is invalid.Pib.Error - if the certificate does not exist.PibImpl.Errorpublic final CertificateV2 getDefaultCertificate() throws Pib.Error, PibImpl.Error
AssertionError - if the backend implementation instance is invalid.Pib.Error - If the default certificate does not exist.PibImpl.Errorpublic static Name constructKeyName(Name identityName, Name.Component keyId)
identityName - The name of the identity.keyId - The key ID name component.public static boolean isValidKeyName(Name keyName)
keyName - The name of the key.public static Name extractIdentityFromKeyName(Name keyName)
keyName - The name of the key.public final void addCertificate_(CertificateV2 certificate) throws CertificateV2.Error, PibImpl.Error
certificate - The certificate to add. This copies the object.IllegalArgumentException - if the name of the certificate does not
match the key name.CertificateV2.ErrorPibImpl.Errorpublic final void removeCertificate_(Name certificateName) throws PibImpl.Error
certificateName - The name of the certificate.IllegalArgumentException - if certificateName does not match the key
name.PibImpl.Errorpublic final CertificateV2 setDefaultCertificate_(Name certificateName) throws Pib.Error, PibImpl.Error
certificateName - The name of the certificate.IllegalArgumentException - if certificateName does not match the key
namePib.Error - if the certificate does not exist.PibImpl.Errorpublic final CertificateV2 setDefaultCertificate_(CertificateV2 certificate) throws CertificateV2.Error, PibImpl.Error, Pib.Error
certificate - The certificate to add. This copies the object.IllegalArgumentException - if the name of the certificate does not
match the key name.CertificateV2.ErrorPibImpl.ErrorPib.Errorpublic final PibCertificateContainer getCertificates_()
Copyright © 2019. All rights reserved.