public class SigningInfo extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SigningInfo.SignerType |
| Constructor and Description |
|---|
SigningInfo()
Create a SigningInfo with a signerType of NULL (which will cause
KeyChain.sign to use the default identity) and an empty signerName,
with other default values.
|
SigningInfo(PibIdentity identity)
Create a SigningInfo of type SignerType.ID according to the given
PibIdentity.
|
SigningInfo(PibKey key)
Create a SigningInfo of type SignerType.KEY according to the given PibKey.
|
SigningInfo(SigningInfo.SignerType signerType)
Create a SigningInfo with the signerType and an empty signerName, with
other default values.
|
SigningInfo(SigningInfo.SignerType signerType,
Name signerName)
Create a SigningInfo with the signerType and signerName, with other default
values.
|
SigningInfo(SigningInfo signingInfo)
Create a SigningInfo as a copy of the given signingInfo.
|
SigningInfo(String signingString)
Create a SigningInfo from its string representation.
|
| Modifier and Type | Method and Description |
|---|---|
DigestAlgorithm |
getDigestAlgorithm()
Get the digest algorithm for public key operations.
|
static Name |
getDigestSha256Identity()
Get the localhost identity which indicates that the signature is generated
using SHA-256.
|
PibIdentity |
getPibIdentity()
Get the PibIdentity of the signer.
|
PibKey |
getPibKey()
Get the PibKey of the signer.
|
Name |
getSignerName()
Get the name of signer.
|
SigningInfo.SignerType |
getSignerType()
Get the type of the signer.
|
ValidityPeriod |
getValidityPeriod()
Get the validity period for the signature info.
|
SigningInfo |
setDigestAlgorithm(DigestAlgorithm digestAlgorithm)
Set the digest algorithm for public key operations.
|
SigningInfo |
setPibIdentity(PibIdentity identity)
Set this to type SignerType.ID according to the given PibIdentity.
|
SigningInfo |
setPibKey(PibKey key)
Set this to type SignerType.KEY according to the given PibKey.
|
SigningInfo |
setSha256Signing()
Set this to type SignerType.SHA256, and set the digest algorithm to
DigestAlgorithm.SHA256.
|
SigningInfo |
setSigningCertificateName(Name certificateName)
Set this to type SignerType.CERT and a certificate with name
certificateName.
|
SigningInfo |
setSigningIdentity(Name identityName)
Set this to type SignerType.ID and an identity with name identityName.
|
SigningInfo |
setSigningKeyName(Name keyName)
Set this to type SignerType.KEY and a key with name keyName.
|
SigningInfo |
setValidityPeriod(ValidityPeriod validityPeriod)
Set the validity period for the signature info.
|
String |
toString()
Get the string representation of this SigningInfo.
|
public SigningInfo(SigningInfo.SignerType signerType, Name signerName)
signerType - The type of signer.signerName - The name of signer. The interpretation of the signerName
differs based on the signerType. This copies the Name.public SigningInfo(SigningInfo.SignerType signerType)
signerType - The type of signer.public SigningInfo()
public SigningInfo(PibIdentity identity)
identity - An existing PibIdentity which is not copied, or a null
PibIdentity. If this is null then use the default identity, otherwise use
identity.getName().public SigningInfo(PibKey key)
key - An existing PibKey which is not copied, or a null PibKey. If
this is null then use the default key for the identity, otherwise use
key.getName().public SigningInfo(String signingString)
signingString - The representative signing string for the signing
method, as follows:
Default signing: "" (the empty string).
Signing with the default certificate of the default key for the identity
with the specified name:
`id:/my-identity`.
Signing with the default certificate of the key with the specified name:
`key:/my-identity/ksk-1`.
Signing with the certificate with the specified name:
`cert:/my-identity/KEY/ksk-1/ID-CERT/%FD%01`.
Signing with sha256 digest: `id:/localhost/identity/digest-sha256` (the
value returned by getDigestSha256Identity()).IllegalArgumentException - if the signingString format is invalid.public SigningInfo(SigningInfo signingInfo)
signingInfo - The SigningInfo to copy.public final SigningInfo setSigningIdentity(Name identityName)
identityName - The name of the identity. This copies the Name.public final SigningInfo setSigningKeyName(Name keyName)
keyName - The name of the key. This copies the Name.public final SigningInfo setSigningCertificateName(Name certificateName)
certificateName - The name of the certificate. This copies the Name.public final SigningInfo setSha256Signing()
public final SigningInfo setPibIdentity(PibIdentity identity)
identity - An existing PibIdentity which is not copied, or a null
PibIdentity. If this is null then use the default identity, otherwise use
identity.getName().public final SigningInfo setPibKey(PibKey key)
key - An existing PibKey which is not copied, or a null PibKey. If
this is null then use the default key for the identity, otherwise use
key.getName().public final SigningInfo.SignerType getSignerType()
public final Name getSignerName()
public final PibIdentity getPibIdentity()
AssertionError - if the signer type is not SignerType.ID.public final PibKey getPibKey()
AssertionError - if the signer type is not SignerType.KEY.public final SigningInfo setDigestAlgorithm(DigestAlgorithm digestAlgorithm)
digestAlgorithm - The digest algorithm.public final DigestAlgorithm getDigestAlgorithm()
public final SigningInfo setValidityPeriod(ValidityPeriod validityPeriod)
validityPeriod - The validity period, which is copied.public final ValidityPeriod getValidityPeriod()
public String toString()
public static Name getDigestSha256Identity()
Copyright © 2019. All rights reserved.