The VerificationHelpers class has static methods to verify signatures and digests. More...
#include <verification-helpers.hpp>
Static Public Member Functions | |
| static bool | verifySignature (const uint8_t *buffer, size_t bufferLength, const uint8_t *signature, size_t signatureLength, const PublicKey &publicKey, DigestAlgorithm digestAlgorithm=DIGEST_ALGORITHM_SHA256) |
| Verify the buffer against the signature using the public key. More... | |
| static bool | verifySignature (const Blob &buffer, const Blob &signature, const PublicKey &publicKey, DigestAlgorithm digestAlgorithm=DIGEST_ALGORITHM_SHA256) |
| Verify the buffer against the signature using the public key. More... | |
| static bool | verifySignature (const uint8_t *buffer, size_t bufferLength, const uint8_t *signature, size_t signatureLength, const Blob &publicKeyDer, DigestAlgorithm digestAlgorithm=DIGEST_ALGORITHM_SHA256) |
| Verify the buffer against the signature using the encoded public key. More... | |
| static bool | verifySignature (const Blob &buffer, const Blob &signature, const Blob &publicKeyDer, DigestAlgorithm digestAlgorithm=DIGEST_ALGORITHM_SHA256) |
| Verify the buffer against the signature using the encoded public key. More... | |
| static bool | verifyDataSignature (const Data &data, const PublicKey &publicKey, DigestAlgorithm digestAlgorithm=DIGEST_ALGORITHM_SHA256, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
| Verify the Data packet using the public key. More... | |
| static bool | verifyDataSignature (const Data &data, const Blob &publicKeyDer, DigestAlgorithm digestAlgorithm=DIGEST_ALGORITHM_SHA256, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
| Verify the Data packet using the public key. More... | |
| static bool | verifyDataSignature (const Data &data, const CertificateV2 &certificate, DigestAlgorithm digestAlgorithm=DIGEST_ALGORITHM_SHA256, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
| Verify the Data packet using the public key in the certificate. More... | |
| static bool | verifyInterestSignature (const Interest &interest, const PublicKey &publicKey, DigestAlgorithm digestAlgorithm=DIGEST_ALGORITHM_SHA256, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
| Verify the Interest packet using the public key, where the last two name components are the SignatureInfo and signature bytes. More... | |
| static bool | verifyInterestSignature (const Interest &interest, const Blob &publicKeyDer, DigestAlgorithm digestAlgorithm=DIGEST_ALGORITHM_SHA256, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
| Verify the Interest packet using the public key, where the last two name components are the SignatureInfo and signature bytes. More... | |
| static bool | verifyInterestSignature (const Interest &interest, const CertificateV2 &certificate, DigestAlgorithm digestAlgorithm=DIGEST_ALGORITHM_SHA256, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
| Verify the Interest packet using the public key in the certificate, where the last two name components are the SignatureInfo and signature bytes. More... | |
| static bool | verifyDigest (const uint8_t *buffer, size_t bufferLength, const uint8_t *digest, size_t digestLength, DigestAlgorithm digestAlgorithm) |
| Verify the buffer against the digest using the digest algorithm. More... | |
| static bool | verifyDigest (const Blob &buffer, const Blob &digest, DigestAlgorithm digestAlgorithm) |
| Verify the buffer against the digest using the digest algorithm. More... | |
| static bool | verifyDataDigest (const Data &data, DigestAlgorithm digestAlgorithm, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
| Verify the Data packet using the digest algorithm. More... | |
| static bool | verifyInterestDigest (const Interest &interest, DigestAlgorithm digestAlgorithm, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
| Verify the Interest packet using the digest algorithm, where the last two name components are the SignatureInfo and signature bytes. More... | |
The VerificationHelpers class has static methods to verify signatures and digests.
|
static |
Verify the Data packet using the digest algorithm.
This does not check the digest algorithm against the type of SignatureInfo in the Data packet such as DigestSha256Signature.
| data | The Data packet to verify. |
| digestAlgorithm | The digest algorithm, such as DIGEST_ALGORITHM_SHA256. |
| wireFormat | (optional) A WireFormat object used to encode the Data packet. If omitted, use WireFormat getDefaultWireFormat(). |
| invalid_argument | for an invalid digestAlgorithm. |
|
static |
Verify the Data packet using the public key.
This does not check the type of public key or digest algorithm against the type of SignatureInfo in the Data packet such as Sha256WithRsaSignature.
| data | The Data packet to verify. |
| publicKey | The object containing the public key. |
| digestAlgorithm | (optional) The digest algorithm. If omitted, use SHA256. |
| wireFormat | (optional) A WireFormat object used to encode the Data packet. If omitted, use WireFormat getDefaultWireFormat(). |
| invalid_argument | for an invalid public key type or digestAlgorithm. |
|
static |
Verify the Data packet using the public key.
This does not check the type of public key or digest algorithm against the type of SignatureInfo in the Data packet such as Sha256WithRsaSignature. If the public key can't be decoded, this returns false instead of throwing a decoding exception. If you want to get a decoding exception then use the PublicKey constructor to decode and call verifyDataSignature with the PublicKey object.
| data | The Data packet to verify. |
| publicKeyDer | The DER-encoded public key. |
| digestAlgorithm | (optional) The digest algorithm. If omitted, use SHA256. |
| wireFormat | (optional) A WireFormat object used to encode the Data packet. If omitted, use WireFormat getDefaultWireFormat(). |
| invalid_argument | for an invalid public key type or digestAlgorithm. |
|
inlinestatic |
Verify the Data packet using the public key in the certificate.
This does not check the type of public key or digest algorithm against the type of SignatureInfo in the Data packet such as Sha256WithRsaSignature.
| data | The Data packet to verify. |
| certificate | The certificate containing the public key. |
| digestAlgorithm | (optional) The digest algorithm. If omitted, use SHA256. |
| wireFormat | (optional) A WireFormat object used to encode the Data packet. If omitted, use WireFormat getDefaultWireFormat(). |
| invalid_argument | for an invalid public key type or digestAlgorithm. |
|
static |
Verify the buffer against the digest using the digest algorithm.
| buffer | A pointer to the input buffer to verify. |
| bufferLength | The length of the buffer. |
| digest | A pointer to the digest bytes. |
| digestLength | The length of the digest. |
| digestAlgorithm | The digest algorithm, such as DIGEST_ALGORITHM_SHA256. |
| invalid_argument | for an invalid digestAlgorithm. |
|
inlinestatic |
Verify the buffer against the digest using the digest algorithm.
| buffer | The input buffer to verify. |
| digest | The digest bytes. |
| digestAlgorithm | The digest algorithm, such as DIGEST_ALGORITHM_SHA256. |
| invalid_argument | for an invalid digestAlgorithm. |
|
static |
Verify the Interest packet using the digest algorithm, where the last two name components are the SignatureInfo and signature bytes.
This does not check the digest algorithm against the type of SignatureInfo such as DigestSha256Signature.
| interest | The Interest packet to verify. |
| digestAlgorithm | The digest algorithm, such as DIGEST_ALGORITHM_SHA256. |
| wireFormat | (optional) A WireFormat object used to decode the Interest packet. If omitted, use WireFormat getDefaultWireFormat(). |
| invalid_argument | for an invalid digestAlgorithm. |
|
static |
Verify the Interest packet using the public key, where the last two name components are the SignatureInfo and signature bytes.
This does not check the type of public key or digest algorithm against the type of SignatureInfo such as Sha256WithRsaSignature.
| interest | The Interest packet to verify. |
| publicKey | The object containing the public key. |
| digestAlgorithm | (optional) The digest algorithm. If omitted, use SHA256. |
| wireFormat | (optional) A WireFormat object used to decode the Interest packet. If omitted, use WireFormat getDefaultWireFormat(). |
| invalid_argument | for an invalid public key type or digestAlgorithm. |
|
static |
Verify the Interest packet using the public key, where the last two name components are the SignatureInfo and signature bytes.
This does not check the type of public key or digest algorithm against the type of SignatureInfo such as Sha256WithRsaSignature. If the public key can't be decoded, this returns false instead of throwing a decoding exception. If you want to get a decoding exception then use the PublicKey constructor to decode and call verifyInterestSignature with the PublicKey object.
| interest | The Interest packet to verify. |
| publicKeyDer | The DER-encoded public key. |
| digestAlgorithm | (optional) The digest algorithm. If omitted, use SHA256. |
| wireFormat | (optional) A WireFormat object used to decode the Interest packet. If omitted, use WireFormat getDefaultWireFormat(). |
| invalid_argument | for an invalid public key type or digestAlgorithm. |
|
inlinestatic |
Verify the Interest packet using the public key in the certificate, where the last two name components are the SignatureInfo and signature bytes.
This does not check the type of public key or digest algorithm against the type of SignatureInfo such as Sha256WithRsaSignature.
| interest | The Interest packet to verify. |
| certificate | The certificate containing the public key. |
| digestAlgorithm | (optional) The digest algorithm. If omitted, use SHA256. |
| wireFormat | (optional) A WireFormat object used to decode the Interest packet. If omitted, use WireFormat getDefaultWireFormat(). |
| invalid_argument | for an invalid public key type or digestAlgorithm. |
|
static |
Verify the buffer against the signature using the public key.
| buffer | A pointer to the input buffer to verify. |
| bufferLength | The length of the buffer. |
| signature | A pointer to the signature bytes. |
| signatureLength | The length of the signature. |
| publicKey | The object containing the public key. |
| digestAlgorithm | (optional) The digest algorithm. If omitted, use SHA256. |
| invalid_argument | for an invalid public key type or digestAlgorithm. |
|
inlinestatic |
Verify the buffer against the signature using the public key.
| buffer | The input buffer to verify. |
| signature | The signature bytes. |
| publicKey | The object containing the public key. |
| digestAlgorithm | (optional) The digest algorithm. If omitted, use SHA256. |
| invalid_argument | for an invalid public key type or digestAlgorithm. |
|
static |
Verify the buffer against the signature using the encoded public key.
If the public key can't be decoded, this returns false instead of throwing a decoding exception. If you want to get a decoding exception then use the PublicKey constructor to decode and call verifySignature with the PublicKey object.
| buffer | A pointer to the input buffer to verify. |
| bufferLength | The length of the buffer. |
| signature | A pointer to the signature bytes. |
| signatureLength | The length of the signature. |
| publicKeyDer | The DER-encoded public key. |
| digestAlgorithm | (optional) The digest algorithm. If omitted, use SHA256. |
| invalid_argument | for an invalid keyType or digestAlgorithm. |
|
inlinestatic |
Verify the buffer against the signature using the encoded public key.
If the public key can't be decoded, this returns false instead of throwing a decoding exception. If you want to get a decoding exception then use the PublicKey constructor to decode and call verifySignature with the PublicKey object.
| buffer | The input buffer to verify. |
| signature | The signature bytes. |
| publicKeyDer | The DER-encoded public key. |
| digestAlgorithm | (optional) The digest algorithm. If omitted, use SHA256. |
| invalid_argument | for an invalid keyType or digestAlgorithm. |
1.8.6