security: renaming methods
1. renaming Verifier::policies to Verifier::policy
2. appending SecTpm related methods with "InTpm"
Change-Id: I3790947d3f236e8d56fd52eaefc6e2bbaea92385
diff --git a/src/security/sec-tpm-osx.cpp b/src/security/sec-tpm-osx.cpp
index cfe7579..cd1b17f 100644
--- a/src/security/sec-tpm-osx.cpp
+++ b/src/security/sec-tpm-osx.cpp
@@ -137,7 +137,7 @@
SecTpmOsx::generateKeyPairInTpm(const Name & keyName, KeyType keyType, int keySize)
{
- if(doesKeyExist(keyName, KEY_CLASS_PUBLIC)){
+ if(doesKeyExistInTpm(keyName, KEY_CLASS_PUBLIC)){
_LOG_DEBUG("keyName has existed");
throw Error("keyName has existed");
}
@@ -171,10 +171,10 @@
}
void
- SecTpmOsx::generateSymmetricKey(const Name & keyName, KeyType keyType, int keySize)
+ SecTpmOsx::generateSymmetricKeyInTpm(const Name & keyName, KeyType keyType, int keySize)
{
- if(doesKeyExist(keyName, KEY_CLASS_SYMMETRIC))
+ if(doesKeyExistInTpm(keyName, KEY_CLASS_SYMMETRIC))
throw Error("keyName has existed!");
string keyNameUri = impl_->toInternalKeyName(keyName, KEY_CLASS_SYMMETRIC);
@@ -220,7 +220,7 @@
}
Block
- SecTpmOsx::sign(const uint8_t *data, size_t dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm)
+ SecTpmOsx::signInTpm(const uint8_t *data, size_t dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm)
{
_LOG_TRACE("OSXPrivateKeyStorage::Sign");
@@ -280,16 +280,16 @@
}
void
- SecTpmOsx::sign(Data &data, const Name& keyName, DigestAlgorithm digestAlgorithm)
+ SecTpmOsx::signInTpm(Data &data, const Name& keyName, DigestAlgorithm digestAlgorithm)
{
data.setSignatureValue
- (sign(data.wireEncode().value(),
+ (signInTpm(data.wireEncode().value(),
data.wireEncode().value_size() - data.getSignature().getValue().size(),
keyName, digestAlgorithm));
}
ConstBufferPtr
- SecTpmOsx::decrypt(const Name & keyName, const uint8_t* data, size_t dataLength, bool sym)
+ SecTpmOsx::decryptInTpm(const Name & keyName, const uint8_t* data, size_t dataLength, bool sym)
{
_LOG_TRACE("OSXPrivateKeyStorage::Decrypt");
@@ -429,7 +429,7 @@
// }
ConstBufferPtr
- SecTpmOsx::encrypt(const Name & keyName, const uint8_t* data, size_t dataLength, bool sym)
+ SecTpmOsx::encryptInTpm(const Name & keyName, const uint8_t* data, size_t dataLength, bool sym)
{
_LOG_TRACE("OSXPrivateKeyStorage::Encrypt");
@@ -465,7 +465,7 @@
}
bool
- SecTpmOsx::doesKeyExist(const Name & keyName, KeyClass keyClass)
+ SecTpmOsx::doesKeyExistInTpm(const Name & keyName, KeyClass keyClass)
{
_LOG_TRACE("OSXPrivateKeyStorage::doesKeyExist");