signature: deprecate Signature in favor of SignatureInfo
The Signature in Data packets and Certificates
has been deprecated in favor of separate objects
representing the Signature info and value.
Also deprecate type-specific Signature helpers.
refs #4804
Change-Id: Iab5b5c618e75cc11d31801d86a89a550a6add7a0
diff --git a/tests/unit/security/v2/key-chain.t.cpp b/tests/unit/security/v2/key-chain.t.cpp
index 1d25e59..b065fb2 100644
--- a/tests/unit/security/v2/key-chain.t.cpp
+++ b/tests/unit/security/v2/key-chain.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -355,7 +355,7 @@
Signature interestSignature(interest.getName()[-2].blockFromValue(), interest.getName()[-1].blockFromValue());
if (signingInfo.getSignerType() == SigningInfo::SIGNER_TYPE_SHA256) {
- BOOST_CHECK_EQUAL(data.getSignature().getType(), tlv::DigestSha256);
+ BOOST_CHECK_EQUAL(data.getSignatureInfo().getSignatureType(), tlv::DigestSha256);
BOOST_CHECK_EQUAL(interestSignature.getType(), tlv::DigestSha256);
BOOST_CHECK(verifyDigest(data, DigestAlgorithm::SHA256));
@@ -363,17 +363,17 @@
}
else if (signingInfo.getSignerType() == SigningInfo::SIGNER_TYPE_HMAC) {
Name keyName = signingInfo.getSignerName();
- BOOST_CHECK_EQUAL(data.getSignature().getType(), tlv::SignatureHmacWithSha256);
+ BOOST_CHECK_EQUAL(data.getSignatureInfo().getSignatureType(), tlv::SignatureHmacWithSha256);
BOOST_CHECK_EQUAL(interestSignature.getType(), tlv::SignatureHmacWithSha256);
BOOST_CHECK(bool(verifySignature(data, tpm, keyName, DigestAlgorithm::SHA256)));
BOOST_CHECK(bool(verifySignature(interest, tpm, keyName, DigestAlgorithm::SHA256)));
}
else {
- BOOST_CHECK_EQUAL(data.getSignature().getType(), tlv::SignatureSha256WithEcdsa);
+ BOOST_CHECK_EQUAL(data.getSignatureInfo().getSignatureType(), tlv::SignatureSha256WithEcdsa);
BOOST_CHECK_EQUAL(interestSignature.getType(), tlv::SignatureSha256WithEcdsa);
- BOOST_CHECK_EQUAL(data.getSignature().getKeyLocator().getName(), cert.getName().getPrefix(-2));
+ BOOST_CHECK_EQUAL(data.getSignatureInfo().getKeyLocator().getName(), cert.getName().getPrefix(-2));
BOOST_CHECK_EQUAL(interestSignature.getKeyLocator().getName(), cert.getName().getPrefix(-2));
BOOST_CHECK(verifySignature(data, key));
@@ -392,16 +392,16 @@
// Create identity with EC key and the corresponding self-signed certificate
Identity id = addIdentity("/ndn/test/ec", EcKeyParams());
BOOST_CHECK_NO_THROW(m_keyChain.sign(data, signingByIdentity(id.getName())));
- BOOST_CHECK_EQUAL(data.getSignature().getType(),
+ BOOST_CHECK_EQUAL(data.getSignatureInfo().getSignatureType(),
KeyChain::getSignatureType(EcKeyParams().getKeyType(), DigestAlgorithm::SHA256));
- BOOST_CHECK(id.getName().isPrefixOf(data.getSignature().getKeyLocator().getName()));
+ BOOST_CHECK(id.getName().isPrefixOf(data.getSignatureInfo().getKeyLocator().getName()));
// Create identity with RSA key and the corresponding self-signed certificate
id = addIdentity("/ndn/test/rsa", RsaKeyParams());
BOOST_CHECK_NO_THROW(m_keyChain.sign(data, signingByIdentity(id.getName())));
- BOOST_CHECK_EQUAL(data.getSignature().getType(),
+ BOOST_CHECK_EQUAL(data.getSignatureInfo().getSignatureType(),
KeyChain::getSignatureType(RsaKeyParams().getKeyType(), DigestAlgorithm::SHA256));
- BOOST_CHECK(id.getName().isPrefixOf(data.getSignature().getKeyLocator().getName()));
+ BOOST_CHECK(id.getName().isPrefixOf(data.getSignatureInfo().getKeyLocator().getName()));
}
BOOST_FIXTURE_TEST_CASE(ImportPrivateKey, IdentityManagementFixture)