diff --git a/gpgme++/key.h b/gpgme++/key.h index 75f301ea3..3a004ba14 100644 --- a/gpgme++/key.h +++ b/gpgme++/key.h @@ -1,301 +1,301 @@ /* key.h - wraps a gpgme key Copyright (C) 2003, 2005 Klarälvdalens Datakonsult AB This file is part of GPGME++. GPGME++ is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. GPGME++ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with GPGME++; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // -*- c++ -*- #ifndef __GPGMEPP_KEY_H__ #define __GPGMEPP_KEY_H__ #include #include #include #include #include #include namespace GpgME { class Subkey; class UserID; // // class Key // class GPGMEPP_EXPORT Key { friend class Context; struct Null {}; public: Key(); /* implicit */ Key( const Null & ); Key( gpgme_key_t key, bool acquireRef ); Key( const Key & key ); ~Key(); static Null null; const Key & operator=( Key other ) { swap( other ); return *this; } void swap( Key & other ) { using std::swap; swap( this->d, other.d ); } bool isNull() const; UserID userID( unsigned int index ) const; Subkey subkey( unsigned int index ) const; unsigned int numUserIDs() const; unsigned int numSubkeys() const; std::vector userIDs() const; std::vector subkeys() const; bool isRevoked() const; bool isExpired() const; bool isDisabled() const; bool isInvalid() const; bool canEncrypt() const; bool canSign() const; bool canCertify() const; bool canAuthenticate() const; bool isQualified() const; bool hasSecret() const; bool isSecret() const { return hasSecret(); } /*! @return true if this is a X.509 root certificate (currently equivalent to something like strcmp( chainID(), subkey(0).fingerprint() ) == 0 ) */ bool isRoot() const; enum OwnerTrust { Unknown=0, Undefined=1, Never=2, Marginal=3, Full=4, Ultimate=5 }; OwnerTrust ownerTrust() const; char ownerTrustAsString() const; typedef Context::Protocol Protocol; Protocol protocol() const; const char * protocolAsString() const; const char * issuerSerial() const; const char * issuerName() const; const char * chainID() const; const char * keyID() const; const char * shortKeyID() const; const char * primaryFingerprint() const; typedef Context::KeyListMode KeyListMode; unsigned int keyListMode() const; private: gpgme_key_t impl() const; class Private; Private * d; }; // // class Subkey // class GPGMEPP_EXPORT Subkey { public: explicit Subkey( gpgme_key_t key=0, gpgme_sub_key_t subkey=0 ); Subkey( gpgme_key_t key, unsigned int idx ); Subkey( const Subkey & other ); ~Subkey(); const Subkey & operator=( Subkey other ) { swap( other ); return *this; } void swap( Subkey & other ) { using std::swap; swap( this->d, other.d ); } bool isNull() const; Key parent() const; const char * keyID() const; const char * fingerprint() const; time_t creationTime() const; time_t expirationTime() const; bool neverExpires() const; bool isRevoked() const; bool isExpired() const; bool isInvalid() const; bool isDisabled() const; bool canEncrypt() const; bool canSign() const; bool canCertify() const; bool canAuthenticate() const; bool isQualified() const; bool isSecret() const; unsigned int publicKeyAlgorithm() const; const char * publicKeyAlgorithmAsString() const; unsigned int length() const; private: class Private; Private * d; }; // // class UserID // class GPGMEPP_EXPORT UserID { public: class Signature; explicit UserID( gpgme_key_t key=0, gpgme_user_id_t uid=0 ); UserID( gpgme_key_t key, unsigned int idx ); UserID( const UserID & other ); ~UserID(); const UserID & operator=( UserID other ) { swap( other ); return *this; } void swap( UserID & other ) { using std::swap; swap( this->d, other.d ); } bool isNull() const; Key parent() const; unsigned int numSignatures() const; Signature signature( unsigned int index ) const; std::vector signatures() const; const char * id() const; const char * name() const; const char * email() const; const char * comment() const; enum Validity { Unknown=0, Undefined=1, Never=2, Marginal=3, Full=4, Ultimate=5 }; Validity validity() const; char validityAsString() const; bool isRevoked() const; bool isInvalid() const; private: class Private; Private * d; }; // // class UserID::Signature // class GPGMEPP_EXPORT UserID::Signature { public: - typedef GpgME::Notation Notation GPGMEPP_DEPRECATED; + typedef GPGMEPP_DEPRECATED GpgME::Notation Notation; explicit Signature( gpgme_key_t key=0, gpgme_user_id_t uid=0, gpgme_key_sig_t sig=0 ); Signature( gpgme_key_t key, gpgme_user_id_t uid, unsigned int idx ); Signature( const Signature & other ); ~Signature(); const Signature & operator=( Signature other ) { swap( other ); return *this; } void swap( Signature & other ) { using std::swap; swap( this->d, other.d ); } bool isNull() const; UserID parent() const; const char * signerKeyID() const; const char * algorithmAsString() const; unsigned int algorithm() const; time_t creationTime() const; time_t expirationTime() const; bool neverExpires() const; bool isRevokation() const; bool isInvalid() const; bool isExpired() const; bool isExportable() const; const char * signerUserID() const; const char * signerName() const; const char * signerEmail() const; const char * signerComment() const; unsigned int certClass() const; enum Status { NoError = 0, SigExpired, KeyExpired, BadSignature, NoPublicKey, GeneralError }; Status status() const; const char * statusAsString() const; const char * policyURL() const; unsigned int numNotations() const; GpgME::Notation notation( unsigned int idx ) const; std::vector notations() const; private: class Private; Private * d; }; } // namespace GpgME GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION( Key ) GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION( Subkey ) GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION( UserID ) GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION( UserID::Signature ) #endif // __GPGMEPP_KEY_H__ diff --git a/gpgme++/verificationresult.h b/gpgme++/verificationresult.h index 564f4c55d..02a4700d8 100644 --- a/gpgme++/verificationresult.h +++ b/gpgme++/verificationresult.h @@ -1,155 +1,155 @@ /* verificationresult.h - wraps a gpgme verify result Copyright (C) 2004 Klarälvdalens Datakonsult AB This file is part of GPGME++. GPGME++ is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. GPGME++ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with GPGME++; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __GPGMEPP_VERIFICATIONRESULT_H__ #define __GPGMEPP_VERIFICATIONRESULT_H__ #include #include #include #include #include namespace GpgME { class Error; class Signature; class Notation; class GPGMEPP_EXPORT VerificationResult : public Result { public: explicit VerificationResult( gpgme_ctx_t ctx=0, int error=0 ); explicit VerificationResult( const Error & err ); VerificationResult( const VerificationResult & other ); ~VerificationResult(); const VerificationResult & operator=( VerificationResult other ) { swap( other ); return *this; } void swap( VerificationResult & other ) { Result::swap( other ); using std::swap; swap( this->d, other.d ); } bool isNull() const; const char * fileName() const; unsigned int numSignatures() const; Signature signature( unsigned int index ) const; std::vector signatures() const; class Private; private: Private * d; }; class GPGMEPP_EXPORT Signature { friend class VerificationResult; Signature( VerificationResult::Private * parent, unsigned int index ); public: - typedef GpgME::Notation Notation GPGMEPP_DEPRECATED; + typedef GPGMEPP_DEPRECATED GpgME::Notation Notation; Signature(); Signature( const Signature & other ); ~Signature(); const Signature & operator=( Signature other ) { swap( other ); return *this; } void swap( Signature & other ) { using std::swap; swap( this->d, other.d ); swap( this->idx, other.idx ); } bool isNull() const; enum Summary { None = 0x000, Valid = 0x001, Green = 0x002, Red = 0x004, KeyRevoked = 0x008, KeyExpired = 0x010, SigExpired = 0x020, KeyMissing = 0x040, CrlMissing = 0x080, CrlTooOld = 0x100, BadPolicy = 0x200, SysError = 0x400 }; Summary summary() const; const char * fingerprint() const; Error status() const; time_t creationTime() const; time_t expirationTime() const; bool neverExpires() const; GPGMEPP_DEPRECATED bool wrongKeyUsage() const { return isWrongKeyUsage(); } bool isWrongKeyUsage() const; enum PKAStatus { UnknownPKAStatus, PKAVerificationFailed, PKAVerificationSucceeded }; PKAStatus pkaStatus() const; const char * pkaAddress() const; enum Validity { Unknown, Undefined, Never, Marginal, Full, Ultimate }; Validity validity() const; char validityAsString() const; Error nonValidityReason() const; unsigned int publicKeyAlgorithm() const; const char * publicKeyAlgorithmAsString() const; unsigned int hashAlgorithm() const; const char * hashAlgorithmAsString() const; const char * policyURL() const; GpgME::Notation notation( unsigned int index ) const; std::vector notations() const; private: VerificationResult::Private * d; unsigned int idx; }; } GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION( VerificationResult ) GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION( Signature ) #endif // __GPGMEPP_VERIFICATIONRESULT_H__