- const char* getAlgorithm() const {
- if (m_key) {
- switch (m_key->getKeyType()) {
- case XSECCryptoKey::KEY_RSA_PRIVATE:
- case XSECCryptoKey::KEY_RSA_PUBLIC:
- case XSECCryptoKey::KEY_RSA_PAIR:
- return "RSA";
-
- case XSECCryptoKey::KEY_DSA_PRIVATE:
- case XSECCryptoKey::KEY_DSA_PUBLIC:
- case XSECCryptoKey::KEY_DSA_PAIR:
- return "DSA";
-
- case XSECCryptoKey::KEY_HMAC:
- return "HMAC";
-
- case XSECCryptoKey::KEY_SYMMETRIC: {
- XSECCryptoSymmetricKey* skey = static_cast<XSECCryptoSymmetricKey*>(m_key);
- switch (skey->getSymmetricKeyType()) {
- case XSECCryptoSymmetricKey::KEY_3DES_192:
- return "DESede";
- case XSECCryptoSymmetricKey::KEY_AES_128:
- return "AES";
- case XSECCryptoSymmetricKey::KEY_AES_192:
- return "AES";
- case XSECCryptoSymmetricKey::KEY_AES_256:
- return "AES";
- }
- }
- }
- }
- return NULL;
- }
-
- unsigned int getKeySize() const {
- if (m_key) {
- switch (m_key->getKeyType()) {
- case XSECCryptoKey::KEY_RSA_PRIVATE:
- case XSECCryptoKey::KEY_RSA_PUBLIC:
- case XSECCryptoKey::KEY_RSA_PAIR: {
- XSECCryptoKeyRSA* rkey = static_cast<XSECCryptoKeyRSA*>(m_key);
- return rkey->getLength();
- }
-
- case XSECCryptoKey::KEY_SYMMETRIC: {
- XSECCryptoSymmetricKey* skey = static_cast<XSECCryptoSymmetricKey*>(m_key);
- switch (skey->getSymmetricKeyType()) {
- case XSECCryptoSymmetricKey::KEY_3DES_192:
- return 192;
- case XSECCryptoSymmetricKey::KEY_AES_128:
- return 128;
- case XSECCryptoSymmetricKey::KEY_AES_192:
- return 192;
- case XSECCryptoSymmetricKey::KEY_AES_256:
- return 256;
- }
- }
- }
- }
- return 0;
- }
-
- XSECCryptoKey* getPrivateKey() const {
- if (m_key) {
- XSECCryptoKey::KeyType type = m_key->getKeyType();
- if (type!=XSECCryptoKey::KEY_RSA_PUBLIC && type!=XSECCryptoKey::KEY_DSA_PUBLIC)
- return m_key;
- }
- return NULL;
- }
-
- XSECCryptoKey* getPublicKey() const {
- if (m_key) {
- XSECCryptoKey::KeyType type = m_key->getKeyType();
- if (type!=XSECCryptoKey::KEY_RSA_PRIVATE && type!=XSECCryptoKey::KEY_DSA_PRIVATE)
- return m_key;
- }
- return NULL;
- }
-
- const std::set<std::string>& getKeyNames() const {
- return m_keyNames;
- }
-
- xmlsignature::KeyInfo* getKeyInfo(bool compact=false) const {
- if (compact || !m_keyInfo)
- return m_compactKeyInfo ? m_compactKeyInfo->cloneKeyInfo() : NULL;
- return m_keyInfo->cloneKeyInfo();
- }
-
- const std::vector<XSECCryptoX509*>& getEntityCertificateChain() const {
- return m_xseccerts;
- }
-
- XSECCryptoX509CRL* getCRL() const {
- return m_crl;
- }
+ // Virtual function overrides.
+ unsigned int getUsage() const;
+ const char* getAlgorithm() const;
+ unsigned int getKeySize() const;
+ XSECCryptoKey* getPrivateKey() const;
+ XSECCryptoKey* getPublicKey() const;
+ const std::set<std::string>& getKeyNames() const;
+ xmlsignature::KeyInfo* getKeyInfo(bool compact=false) const;
+ const std::vector<XSECCryptoX509*>& getEntityCertificateChain() const;
+ XSECCryptoX509CRL* getCRL() const;
+ const std::vector<XSECCryptoX509CRL*>& getCRLs() const;
+ const char* getSubjectName() const;
+ const char* getIssuerName() const;
+ const char* getSerialNumber() const;
+ void extract();