FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
OMEcrypto.h
Go to the documentation of this file.
1 #ifndef _OME_CRYPTO_H
2 #define _OME_CRYPTO_H "$Id: OMEcrypto.h 446 2020-07-23 20:08:31Z geoff $"
4 
10 #include <OMEtype.h>
11 
12 enum {
17 };
18 
22 extern OMEstring *OMEmakeRandomKey(int32_t bits = 1024);
23 
27 extern OMEstring *OMEmakeSHA1hash(const OMEstring &message);
28 
32 extern OMEstring *OMEmakeSHA256hash(const OMEstring &message);
33 
37 extern OMEstring *OMEmakeMD5hash(const OMEstring &message);
38 
39 extern OMEstring *OMEmakePrivateKey(const OMEstring &secretPhrase);
40 
41 extern OMEstring *OMEmakePublicKey(const OMEstring &privateKey);
42 
43 extern OMEstring *OMEmakeSessionKeyFromPublicKey(const OMEstring &publicKey,
44  OMEstring &randomDataInSessionKeyOut);
45 
47  const OMEstring &data);
48 
49 extern int OMEinitNewCipher(const OMEstring &initVector);
50 
51 extern int OMEfreeCipher(int useCipher);
52 
53 extern int OMEdefineNewEncryptKey(const OMEstring &key);
54 
55 extern int OMEdefineNewDecryptKey(const OMEstring &key);
56 
57 extern int OMEfreeEncryptionKey(int useKey);
58 
59 extern int OMEfreeDecryptionKey(int useKey);
60 
61 extern int OMEencryptString(int useCipher, int useKey, const OMEstring &input,
62  OMEstring &result);
63 
64 extern int OMEdecryptString(int useCipher, int useKey, const OMEstring &input,
65  OMEstring &result);
66 
67 extern OMEstring *OMEreadLicenseFile(OMEstring *retFileName, const OMEstring &fileSuffix, const char *searchPath);
68 
69 extern OMEtype *OMEgetLicenseAttribute(const OMEstring &attrName, OMEstring *retFileName = 0);
70 
71 extern OMEtype *OMEgetLicenseAttribute(const char *attrName, OMEstring *retFileName = 0);
72 
73 extern OMEtype *OMEgetSigningFile(const OMEstring &secret, const OMEstring &logicalDomain, bool isPublic = false);
74 
75 enum {
86 };
87 
91 #endif
92 /* vim: set expandtab shiftwidth=4 tabstop=4: */
OILsetClassMetaObject
int OILsetClassMetaObject(OMEthread *thread, OMEtype &result, const OMEtype &classData, const OMEtype &metaObj)
Definition: OMEcreate.cpp:190
OMEmakeACL
OMEassoc * OMEmakeACL(const OMEstring &entity, uint_fast32_t defaultPermission, const OMEassoc &methodList)
Definition: OMEobjACL.cpp:164
OMEreadLicenseFile
OMEstring * OMEreadLicenseFile(OMEstring *retFileName, const OMEstring &fileSuffix, const char *searchPath)
Definition: OMElicense.cpp:395
OME_NLM
@ OME_NLM
Definition: OMEmanifests.h:90
OME_ERROR_CRYPTO_INTEGRITY2
@ OME_ERROR_CRYPTO_INTEGRITY2
Definition: OMEcrypto.h:85
OMEinitNewCipher
int OMEinitNewCipher(const OMEstring &initVector)
Definition: aesCover.cpp:29
OME_ERROR_CRYPTO_WRONG_USER
@ OME_ERROR_CRYPTO_WRONG_USER
Definition: OMEcrypto.h:84
OMEtype::initializeAsType
void initializeAsType(const enum OMEtypes_t t)
The fundamental tagged data type used through the FARGOS/VISTA infrastructure.
Definition: OMEtype.cpp:95
_noteShutdownThread
int _noteShutdownThread(OMEthread *thread, OMEtype &result)
Definition: OMEcreate.cpp:126
OME_ERROR_CRYPTO_DECODE_FAILED
@ OME_ERROR_CRYPTO_DECODE_FAILED
Definition: OMEcrypto.h:79
OMEmakeSHA1hash
OMEstring * OMEmakeSHA1hash(const OMEstring &message)
Compute Secure Hash Algorithm 1 over an OMEstring.
Definition: pkRoutines.cpp:83
OMEcreateObject
OMEoid * OMEcreateObject(const OMEstring &className, const OMEassoc &defaultACL, const uint32_t argc, const OMEarray &argv, const OMEtype *fromObject=nullptr, const OMEthread *fromThread=nullptr, const OMEoid *notify=nullptr, const uint32_t verID=0, const OMEstring *nmSpace=nullptr, OMEtype *errInfo=nullptr)
Definition: OMEcreate.cpp:15
OME_ERROR_CRYPTO_BAD_VERSION
@ OME_ERROR_CRYPTO_BAD_VERSION
Definition: OMEcrypto.h:76
ARG_IS_INT
#define ARG_IS_INT(x)
Definition: OMEcreate.cpp:9
OME_SHA1_HASH_LEN_IN_BITS
@ OME_SHA1_HASH_LEN_IN_BITS
Definition: OMEcrypto.h:15
OMEruntime.h
OMEassoc
Implements associative array of OMEtype elements.
Definition: OMEassoc.h:112
OILcreateObject
int OILcreateObject(OMEthread *thread, OMEtype &result, const OMEtype &classData, const OMEtype &acl, const OMEtype &args, const OMEtype &from, const OMEtype &notifyObj)
Definition: OMEcreate.cpp:28
OMEthread::getThisOID
const OMEoid & getThisOID() const OME_ALWAYS_INLINE
Definition: OMEthread.h:154
OME_ERROR_CRYPTO_INTEGRITY1
@ OME_ERROR_CRYPTO_INTEGRITY1
Definition: OMEcrypto.h:78
OMEstring
Implements text and binary string storage.
Definition: OMEstring.h:305
OMEfreeEncryptionKey
int OMEfreeEncryptionKey(int useKey)
Definition: aesCover.cpp:111
OMEclass::setMetaObject
void setMetaObject(const OMEoid &obj)
Definition: OMEclass.h:69
OMEarray::indexExists
bool indexExists(const uint32_t i) const
Definition: OMEarray.h:202
OME_ERROR_CRYPTO_INIT_FAILED
@ OME_ERROR_CRYPTO_INIT_FAILED
Definition: OMEcrypto.h:82
OILimportObject
int OILimportObject(OMEthread *thread, OMEtype &result, const OMEtype &objData, const OMEtype &duplicateFlag)
Definition: OMEcreate.cpp:239
OMEtype::value
union OMEtype::@26 value
OME_SHA1_HASH_LEN_IN_BYTES
@ OME_SHA1_HASH_LEN_IN_BYTES
Definition: OMEcrypto.h:16
OMEencryptString
int OMEencryptString(int useCipher, int useKey, const OMEstring &input, OMEstring &result)
Definition: aesCover.cpp:124
OMEtype
Fundamental ANY type for FARGOS/VISTA Object Management Environment.
Definition: OMEbaseType.h:250
OMEobject
Base class and abstract interface for an object within a FARGOS/VISTA Object Management Environment.
Definition: OMEobject.h:22
OMEmakePublicKey
OMEstring * OMEmakePublicKey(const OMEstring &privateKey)
Definition: pkRoutines.cpp:192
OMEmakeMD5hash
OMEstring * OMEmakeMD5hash(const OMEstring &message)
Compute Message Digest 5 over an OMEstring.
Definition: pkRoutines.cpp:100
OMEtype::oid
class OMEoid * oid
Definition: OMEbaseType.h:297
OMEmakeSessionKeyFromPublicKey
OMEstring * OMEmakeSessionKeyFromPublicKey(const OMEstring &publicKey, OMEstring &randomDataInSessionKeyOut)
Definition: pkRoutines.cpp:255
OME_ERROR_CRYPTO_WRONG_HOST
@ OME_ERROR_CRYPTO_WRONG_HOST
Definition: OMEcrypto.h:83
OMEtype::s
class OMEstring * s
Definition: OMEbaseType.h:299
OMEobjACL.h
OMEdecryptString
int OMEdecryptString(int useCipher, int useKey, const OMEstring &input, OMEstring &result)
Definition: aesCover.cpp:179
OMEgetLicenseAttribute
OMEtype * OMEgetLicenseAttribute(const OMEstring &attrName, OMEstring *retFileName=0)
Definition: OMElicense.cpp:521
_noteObjectCreator
int _noteObjectCreator(OMEthread *thread, OMEtype &result, const OMEtype &obj)
Definition: OMEcreate.cpp:105
OMEtype::array
class OMEarray * array
Definition: OMEbaseType.h:294
OMEthread::releaseThread
OMEthread * releaseThread()
Definition: OMEthread.cpp:1126
OMEclass
FARGOS/VISTA Object Management Environment class description.
Definition: OMEclass.h:24
OMEthread::suspendThread
void suspendThread()
Definition: OMEthread.cpp:1086
OMEfindClassDescription
OMEclass * OMEfindClassDescription(const OMEstring &className, const uint32_t verID, const OMEstring *nmSpace)
Definition: OMEnamespace.cpp:165
OME_ERROR_CRYPTO_DECODE_ARRAY
@ OME_ERROR_CRYPTO_DECODE_ARRAY
Definition: OMEcrypto.h:80
OMEmakeSHA256hash
OMEstring * OMEmakeSHA256hash(const OMEstring &message)
Compute Secure Hash Algorithm 256 over an OMEstring.
Definition: sha256.cpp:169
srcID
const char srcID[]
Definition: catSym.c:17
OME_STRING
@ OME_STRING
Definition: OMEmanifests.h:85
makeOIDwithACL
int makeOIDwithACL(OMEthread *thread, OMEtype &result, const OMEtype &acl)
Definition: OMEcreate.cpp:175
OME_INT
@ OME_INT
Definition: OMEmanifests.h:80
OMEdecryptSessionKeyWithPrivateKey
OMEstring * OMEdecryptSessionKeyWithPrivateKey(const OMEstring &privateKey, const OMEstring &data)
Definition: pkRoutines.cpp:296
OMEmakePrivateKey
OMEstring * OMEmakePrivateKey(const OMEstring &secretPhrase)
Definition: pkRoutines.cpp:156
OMEdefineNewEncryptKey
int OMEdefineNewEncryptKey(const OMEstring &key)
Definition: aesCover.cpp:95
OMEdefineNewDecryptKey
int OMEdefineNewDecryptKey(const OMEstring &key)
Definition: aesCover.cpp:103
OME_NIL
@ OME_NIL
Definition: OMEmanifests.h:78
OME_OID
@ OME_OID
Definition: OMEmanifests.h:84
OMEfreeDecryptionKey
int OMEfreeDecryptionKey(int useKey)
Definition: aesCover.cpp:119
OMEobjectInstance::importObject
static OME_FAST_CALL OMEoid * importObject(const OMEstring &data, bool duplicate, OMEtype *errInfo=nullptr)
Import an object from its encoded image.
Definition: OMEobject.cpp:1010
OME_INIT_VEC_LEN_IN_HEX_BYTES
@ OME_INIT_VEC_LEN_IN_HEX_BYTES
Definition: OMEcrypto.h:14
OMEtype.h
OME fundamental type implementation.
OMEtype::ui
uint32_t ui
Definition: OMEbaseType.h:286
OMEcoreInternal.h
makeExclusionACL
int makeExclusionACL(OMEthread *thread, OMEtype &result, const OMEtype &methods)
Definition: OMEcreate.cpp:146
OME_USED
const char srcID[] OME_USED
Definition: tick_time.cpp:24
OMEarray::elementCount
uint_fast32_t elementCount() const OME_ALWAYS_INLINE
Definition: OMEarray.h:247
OMEfreeCipher
int OMEfreeCipher(int useCipher)
Definition: aesCover.cpp:56
OMEobjectInstance::createObjectOfClass
static OME_FAST_CALL OMEoid * createObjectOfClass(const uint32_t argc, const OMEarray &argv, const OMEassoc &acl, const OMEstring &name, const OMEtype *fromObject=nullptr, const OMEthread *fromThread=nullptr, const OMEoid *notify=nullptr, const uint32_t verID=0, const OMEstring *nmSpace=nullptr, OMEtype *errInfo=nullptr)
Create an object, potentially searching through the OMEnameSpaceGroup list for most current version o...
Definition: OMEobject.cpp:1250
OMEgetSigningFile
OMEtype * OMEgetSigningFile(const OMEstring &secret, const OMEstring &logicalDomain, bool isPublic=false)
Definition: OMElicense.cpp:648
OME_ERROR_CRYPTO_BAD_DATA
@ OME_ERROR_CRYPTO_BAD_DATA
Definition: OMEcrypto.h:81
OMEarray
Implements sparse array of OMEtype elements.
Definition: OMEarray.h:75
OMEthread
Public interface to an OME thread.
Definition: OMEthread.h:60
LOG_ENDLINE
#define LOG_ENDLINE
Closing clause for text line output using << operators.
Definition: logging_api.hpp:2956
OMEoid
Public interface to an OME Object Identifier.
Definition: OMEoid.h:196
OMEmakeRandomKey
OMEstring * OMEmakeRandomKey(int32_t bits=1024)
Generate a random sequence of bits.
Definition: pkRoutines.cpp:46
OMEtype::type
uint32_t type
Definition: OMEbaseType.h:304
OMEgetObjectCreatorOID
OMEtype & OMEgetObjectCreatorOID(const OMEtype &userInfo)
Definition: OMEcreate.cpp:117
OME_ARRAY
@ OME_ARRAY
Definition: OMEmanifests.h:86
OMEarray::ARRAY_SUBSCRIPT_t
OMEarrayStorage::ARRAY_SUBSCRIPT_t ARRAY_SUBSCRIPT_t
Definition: OMEarray.h:90
OMEtype::assoc
class OMEassoc * assoc
Definition: OMEbaseType.h:296
OMEthread::threadErrorCode
OMEtype threadErrorCode
Definition: OMEthread.h:81
OMEoid::getInstanceInMemory
const class OMEobject * getInstanceInMemory() const
Return object information record.
Definition: OMEoid.h:280
OME_ASSOC
@ OME_ASSOC
Definition: OMEmanifests.h:87
OMEsendShutdown
int OMEsendShutdown()
Definition: OMEcreate.cpp:136
OME_INIT_VEC_LEN_IN_BITS
@ OME_INIT_VEC_LEN_IN_BITS
Definition: OMEcrypto.h:13
LOG_CERR
#define LOG_CERR(lvl)
Convenience macro that uses LOG_INTO() to conditionally log a message to standard error.
Definition: logging_api.hpp:3014
OME_ERROR_CRYPTO_BAD_MAGIC
@ OME_ERROR_CRYPTO_BAD_MAGIC
Definition: OMEcrypto.h:77
logging_api.hpp
FARGOS Logging API.
Generated: Fri Jul 31 2020 18:19:14
Support Information