/*
- * Copyright 2001-2009 Internet2
+ * Copyright 2001-2010 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
}
-Encrypter::Encrypter() : m_cipher(NULL)
+Encrypter::Encrypter() : m_cipher(nullptr)
{
}
}
}
- XSECCryptoKey* key=NULL;
+ XSECCryptoKey* key=nullptr;
if (encParams.m_credential) {
key = encParams.m_credential->getPrivateKey();
if (!key)
else {
// We have to have a raw key now, so we need to build a wrapper around it.
XSECAlgorithmHandler* handler =XSECPlatformUtils::g_algorithmMapper->mapURIToHandler(encParams.m_algorithm);
- if (handler != NULL)
+ if (handler != nullptr)
key = handler->createKeyForURI(
encParams.m_algorithm,const_cast<unsigned char*>(encParams.m_keyBuffer),encParams.m_keyBufferSize
);
if (m_cipher && m_cipher->getDocument()!=element->getOwnerDocument()) {
XMLToolingInternalConfig::getInternalConfig().m_xsecProvider->releaseCipher(m_cipher);
- m_cipher=NULL;
+ m_cipher=nullptr;
}
if (!m_cipher) {
if (m_cipher && m_cipher->getDocument()!=element->getOwnerDocument()) {
XMLToolingInternalConfig::getInternalConfig().m_xsecProvider->releaseCipher(m_cipher);
- m_cipher=NULL;
+ m_cipher=nullptr;
}
if (!m_cipher) {
if (m_cipher) {
XMLToolingInternalConfig::getInternalConfig().m_xsecProvider->releaseCipher(m_cipher);
- m_cipher=NULL;
+ m_cipher=nullptr;
}
- DOMDocument* doc=NULL;
+ DOMDocument* doc=nullptr;
try {
doc=XMLToolingConfig::getConfig().getParser().newDocument();
XercesJanitor<DOMDocument> janitor(doc);
throw EncryptionException("No EncryptedData element found?");
// Unmarshall a tooling version of EncryptedData around the DOM.
- EncryptedData* xmlEncData=NULL;
+ EncryptedData* xmlEncData=nullptr;
auto_ptr<XMLObject> xmlObject(XMLObjectBuilder::buildOneFromElement(encData->getElement()));
if (!(xmlObject.get()) || !(xmlEncData=dynamic_cast<EncryptedData*>(xmlObject.get())))
throw EncryptionException("Unable to unmarshall into EncryptedData object.");
xmlEncData->releaseThisAndChildrenDOM();
// KeyInfo?
- KeyInfo* kinfo = encParams.m_credential ? encParams.m_credential->getKeyInfo(encParams.m_compact) : NULL;
+ KeyInfo* kinfo = encParams.m_credential ? encParams.m_credential->getKeyInfo(encParams.m_compact) : nullptr;
if (kinfo)
xmlEncData->setKeyInfo(kinfo);
auto_ptr<XENCEncryptedKey> encKey(
m_cipher->encryptKey(encParams.m_keyBuffer, encParams.m_keyBufferSize, ENCRYPT_NONE, kencParams->m_algorithm)
);
- EncryptedKey* xmlEncKey=NULL;
+ EncryptedKey* xmlEncKey=nullptr;
auto_ptr<XMLObject> xmlObjectKey(XMLObjectBuilder::buildOneFromElement(encKey->getElement()));
if (!(xmlObjectKey.get()) || !(xmlEncKey=dynamic_cast<EncryptedKey*>(xmlObjectKey.get())))
throw EncryptionException("Unable to unmarshall into EncryptedKey object.");
if (m_cipher) {
XMLToolingInternalConfig::getInternalConfig().m_xsecProvider->releaseCipher(m_cipher);
- m_cipher=NULL;
+ m_cipher=nullptr;
}
XSECCryptoKey* kek = kencParams.m_credential.getPublicKey();
if (!kek)
throw EncryptionException("Credential in KeyEncryptionParams structure did not supply a public key.");
- DOMDocument* doc=NULL;
+ DOMDocument* doc=nullptr;
try {
doc=XMLToolingConfig::getConfig().getParser().newDocument();
XercesJanitor<DOMDocument> janitor(doc);
m_cipher->setKEK(kek->clone());
auto_ptr<XENCEncryptedKey> encKey(m_cipher->encryptKey(keyBuffer, keyBufferSize, ENCRYPT_NONE, kencParams.m_algorithm));
- EncryptedKey* xmlEncKey=NULL;
+ EncryptedKey* xmlEncKey=nullptr;
auto_ptr<XMLObject> xmlObjectKey(XMLObjectBuilder::buildOneFromElement(encKey->getElement()));
if (!(xmlObjectKey.get()) || !(xmlEncKey=dynamic_cast<EncryptedKey*>(xmlObjectKey.get())))
throw EncryptionException("Unable to unmarshall into EncryptedKey object.");
return DSIGConstants::s_unicodeStrURIKW_3DES;
}
- return NULL;
+ return nullptr;
}