MCTSigner Class Reference

class MCTSigner : public MCTTokenObject

A template for signer objects. It isn't possible to use a base class as the signature objects created are not related.

This template is be instantiated with a CRSASignature* as the signature class for RSA signatures and with a CDSASignature* as the Signature for DSA.

Inherits from

Constructor & Destructor Documentation

MCTSigner(MCTToken &)

MCTSigner(MCTToken &aToken)[protected, inline]

Parameters

MCTToken & aToken

~MCTSigner()

~MCTSigner()[protected, inline, pure virtual]

Member Functions Documentation

CancelSign()

voidCancelSign()[pure virtual]

Cancel an ongoing Sign() or SignMessage() operation.

Sign(const TDesC8 &, Signature &, TRequestStatus &)

voidSign(const TDesC8 &aPlaintext,
Signature &aSignature,
TRequestStatus &aStatus
)[pure virtual]

Perform a raw signing operation.

capability
Dependent Requires the caller to have any capabilities specified in the key use security policy.
leave
KErrPermissionDenied If the caller does not conform to the key use security policy.
leave
KErrBadPassphrase If the user failed to enter the correct passphrase.

Parameters

const TDesC8 & aPlaintextThe string to be signed - this should be some form of hash of the actual message to be signed. In order to generate valid PKCS#1 v1.5 signature aPlainText should consist of ASN.1 encoded digest algorithm ID and hash as described in RFC2313. If the data is too long, this method will return KErrOverflow through aStatus.
Signature & aSignatureThe returned signature. A new signature object is created which is owned by the caller.
TRequestStatus & aStatus

SignMessage(const TDesC8 &, Signature &, TRequestStatus &)

voidSignMessage(const TDesC8 &aPlaintext,
Signature &aSignature,
TRequestStatus &aStatus
)[pure virtual]

Sign some data.

The data is hashed before the signature is created using the SHA-1 algorithm.

capability
Dependent Requires the caller to have any capabilities specified in the key use security policy.
leave
KErrPermissionDenied If the caller does not conform to the key use security policy.
leave
KErrBadPassphrase If the user failed to enter the correct passphrase.

Parameters

const TDesC8 & aPlaintextThe string to be signed.
Signature & aSignatureThe returned signature. A new signature object is created which is owned by the caller.
TRequestStatus & aStatus