Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TProviderOperation
Inherited By:
None.
Purpose:
The TBasicChallenge class is the derived class of the TProviderOperation base class that implements the BasicChallenge protocol that is described in the LSAPI Specification. This challenge protocol is used by the product to authenticate the activation key, and thereby the path to the activation key. The Basic Challenge protocol works on the principle of shared secrets. The protocol requires that at least four 32-bit secrets be stored in each activation key that wants to participate in this protection scheme. These secrets, chosen by the software publisher, are encrypted within the activation key itself, with only the license provider knowing how to decrypt them. In order to perform the challenge, the product generates a random value and an index into the list of secrets, which it passes as the challenge to the license provider. The license provider combines the random value with the selected secret from the activation key. This data is fed into the MD4 message digest algorithm (one-way encrypting scheme), yielding a unique message digest. The message digest is returned as the response to the challenge. The product then computes the expected message digest and compares it with the one returned by the license provider.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
None
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TBasicChallenge ()
- TBasicChallenge (const unsigned long indexOfSecret, const unsigned long randomNumber)
- TBasicChallenge (const TBasicChallenge &)
Interface Category:
API.
Purpose:
- Default constructor.
- Construct a basic challenge request.
- Copy constructor.
Calling Context:
- Called by the stream-in operators.
- Called by the product to set up the challenge.
- Called to copy an object.
Parameters:
- Takes no parameters.
- const unsigned long indexOfSecret -Index into the list of secrets.
- const unsigned long randomNumber -Random number.
- const TBasicChallenge & -Object to copy.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TBasicChallenge ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
TBasicChallenge & operator =(const TBasicChallenge &)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
Return Value:
A non-const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
TStream & operator >>=(TStream & toWhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
Return Value:
Returns a reference to the stream the object streams itself out to.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
TStream & operator <<= (TStream & fromWhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & fromWhere -Source stream.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws TInvalidVersionError if the version of the object is not recognized.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBasicChallenge::GetIndexOfSecret
unsigned long GetIndexOfSecret () const
Interface Category:
API.
Purpose:
Returns the index into the list of secrets that was specified at object construction time. This member function is typically used by the license provider to identify the secret that should be used in executing the TBasicChallenge operation.
Calling Context:
Called by the provider to get the index of the secret that is to be used in answering the challenge.
Parameters:
Return Value:
Returns the index of the secret.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None
void SetSecret (const TPrimitiveTypeArray < unsigned char >& message)
Interface Category:
API.
Purpose:
Used by the license provider to set the result of the TBasicChallenge operation.
Calling Context:
Called by the provider to set the secret as the result to the challenge.
Parameters:
- const TPrimitiveTypeArray < unsigned char >& message -Message whose digest is to be added to the object.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBasicChallenge::CompareSecret
bool CompareSecret (const TPrimitiveTypeArray <unsigned char> & message) const
Interface Category:
API.
Purpose:
Used by the product to compare the results of a TBasicChallenge operation with those that were expected.
Calling Context:
Called by the licensed product to check the results of a basic challenge. If the integrity of the CompareSecret routine is in question, the licensed product should directly implement the comparison in its own code. To enable this, the necessary data members are public.
Parameters:
- const TPrimitiveTypeArray < unsigned char >& message -Message whose digest is to be compared with the one in the object.
Return Value:
Returns true if equal.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBasicChallenge::GetOperationType
virtual void GetOperationType (TStandardText & token) const
Interface Category:
API.
Purpose:
Overrides inherited TProviderOperation function.
Calling Context:
Same as TProviderOperation function.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.