// cciV1Card.h: interface for the CV1Card class. // // (c) Copyright Schlumberger Technology Corp., unpublished work, created // 1999. This computer program includes Confidential, Proprietary // Information and is a Trade Secret of Schlumberger Technology Corp. All // use, disclosure, and/or reproduction is prohibited unless authorized // in writing. All Rights Reserved. ////////////////////////////////////////////////////////////////////// // Note: This header file should only be included by the CCI. The // client gets the declarations via cciCard.h #if !defined(CCI_V1CARD_H) #define CCI_V1CARD_H #include // for auto_ptr #include #include #include #include #include "ACard.h" #include "cciCont.h" #include "cciCert.h" #include "cciKeyPair.h" #include "cciPubKey.h" #include "cciPriKey.h" #include "cciDataObj.h" #include "ArchivedValue.h" namespace cci { class CV1Card // concrete class : public CAbstractCard { friend CAbstractCard * CAbstractCard::Make(std::string const &rstrReaderName); public: // Types // C'tors/D'tors virtual ~CV1Card() throw(); // Operators // Operations void CardId(std::string const &rsNewCardId) const; virtual void ChangePIN(scu::SecureArray const &rstrOldPIN, scu::SecureArray const &rstrNewPIN); virtual void DefaultContainer(CContainer const &rcont); virtual std::pair GenerateKeyPair(KeyType kt, std::string const &rsExponent, ObjectAccess oaPrivateKey = oaPrivateAccess); virtual void InitCard(); virtual void InvalidateCache(); virtual void Label(std::string const &rstrLabel); DWORD OpenFile(char const *szPath) const; virtual void VerifyKey(std::string const &rstrKey, BYTE bKeyNum); // Access size_t AvailableStringSpace(ObjectAccess oa) const; std::string CardId() const; virtual CContainer DefaultContainer() const; virtual std::vector EnumContainers() const; virtual std::vector EnumCertificates(ObjectAccess access) const; virtual std::vector EnumPublicKeys(ObjectAccess access) const; virtual std::vector EnumPrivateKeys(ObjectAccess access) const; virtual std::vector EnumDataObjects(ObjectAccess access) const; virtual std::string Label() const; BYTE MaxKeys(KeyType kt) const; size_t MaxStringSpace(ObjectAccess oa) const; virtual bool SupportedKeyFunction(KeyType kt, CardOperation oper) const; virtual scu::Marker MarkerOnCard() const; // Predicates virtual bool IsCAPIEnabled() const; virtual bool IsPKCS11Enabled() const; virtual bool IsEntrustEnabled() const; virtual bool IsProtectedMode() const; virtual bool IsKeyGenEnabled() const; virtual BYTE MajorVersion() const; virtual bool IsMarkerOnCard() const; protected: // Types // C'tors/D'tors CV1Card(std::string const &rstrReaderName, std::auto_ptr &rapiop, std::auto_ptr &rapSmartCard); // Operators // Operations void DoSetup(); virtual CAbstractCertificate * MakeCertificate(ObjectAccess oa) const; virtual CAbstractContainer * MakeContainer() const; virtual CAbstractDataObject * MakeDataObject(ObjectAccess oa) const; virtual CAbstractKeyPair * MakeKeyPair(CContainer const &rhcont, KeySpec ks) const; virtual CAbstractPrivateKey * MakePrivateKey(ObjectAccess oa) const; virtual CAbstractPublicKey * MakePublicKey(ObjectAccess oa) const; // Access // Predicates // Variables private: // Types typedef CAbstractCard SuperClass; // C'tors/D'tors // Operators // Operations static std::auto_ptr DoMake(std::string const &rstrReaderName, std::auto_ptr &rapiop, std::auto_ptr &rapSmartCard); std::string ReadCardId() const; void RefreshCardId() const; // Access // Predicates // Variables std::string mutable m_sCardId; CArchivedValue mutable m_avhDefaultCntr; CArchivedValue mutable m_avhExchangeKeyPair; CArchivedValue mutable m_avhSignatureKeyPair; }; } // namespace cci #endif // CCI_CV1CARD_H