crypto/weakcryptospi/inc/spi/asymmetriccipherplugin.h
changeset 30 cf642210ecb7
parent 8 35751d3474b7
equal deleted inserted replaced
19:ece3df019add 30:cf642210ecb7
    40 	public:
    40 	public:
    41 		
    41 		
    42 		/**
    42 		/**
    43 		Set the public key of this cipher. Reset() is called to reinitialise the cipher.
    43 		Set the public key of this cipher. Reset() is called to reinitialise the cipher.
    44 		@param aKey	The public key.
    44 		@param aKey	The public key.
       
    45 		@leave KErrArgument if aKey is not of the expected type.
       
    46 		@leave KErrNotSupported if the key is not of valid length.
       
    47 		@leave ...	Any of the crypto error codes defined in 
       
    48   					cryptospi_errs.h or any of the system-wide error codes.
    45 		*/
    49 		*/
    46 		virtual void SetKeyL(const CKey& aKey) = 0;
    50 		virtual void SetKeyL(const CKey& aKey) = 0;
    47 
    51 
    48 		/**
    52 		/**
    49 		Set the crypto mode of this cipher. Reset() is called to reinitialise the cipher.
    53 		Set the crypto mode of this cipher. Reset() is called to reinitialise the cipher.
    50 		@param aCryptoMode	The crypto mode
    54 		@param aCryptoMode	The crypto mode
       
    55 		@leave KErrNotSupported if the specified mode is not supported.
       
    56 		@leave ...	Any of the crypto error codes defined in 
       
    57   					cryptospi_errs.h or any of the system-wide error codes.
    51 		*/
    58 		*/
    52 		virtual void SetCryptoModeL(TUid aCryptoMode) = 0;
    59 		virtual void SetCryptoModeL(TUid aCryptoMode) = 0;
    53 
    60 
    54 		/**
    61 		/**
    55 		Set padding Mode of this cipher. Reset() is called to reinitialise the cipher.
    62 		Set padding Mode of this cipher. Reset() is called to reinitialise the cipher.
    56 		@param aPaddingMode	The padding mode
    63 		@param aPaddingMode	The padding mode
       
    64 		@leave	KErrNotSupported if the specified mode is not supported.
       
    65 		@leave ...	Any of the crypto error codes defined in 
       
    66   					cryptospi_errs.h or any of the system-wide error codes.
    57 		*/
    67 		*/
    58 		virtual void SetPaddingModeL(TUid aPaddingMode) = 0;
    68 		virtual void SetPaddingModeL(TUid aPaddingMode) = 0;
    59 
    69 
    60 		/**
    70 		/**
    61 		Gets the maximum size of input accepted by this object.	
    71 		Gets the maximum size of input accepted by this object.	
    62 		@return The maximum input length allowed in bytes.
    72 		@return The maximum input length allowed in bytes.
       
    73 		@leave ...	Any of the crypto error codes defined in 
       
    74   					cryptospi_errs.h or any of the system-wide error codes.
    63 		*/	 
    75 		*/	 
    64 		virtual TInt GetMaximumInputLengthL() const = 0;
    76 		virtual TInt GetMaximumInputLengthL() const = 0;
    65 
    77 
    66 		/**
    78 		/**
    67 		Gets the maximum size of output that can be generated by this object.
    79 		Gets the maximum size of output that can be generated by this object.
    68 		@return The maximum output length in bytes.
    80 		@return The maximum output length in bytes.
       
    81 		@leave ...	Any of the crypto error codes defined in 
       
    82   					cryptospi_errs.h or any of the system-wide error codes.
    69 		 */	 
    83 		 */	 
    70 		virtual TInt GetMaximumOutputLengthL() const = 0;
    84 		virtual TInt GetMaximumOutputLengthL() const = 0;
    71 		};
    85 		};
    72 
    86 
    73 	class MAsymmetricCipher : public MAsymmetricCipherBase
    87 	class MAsymmetricCipher : public MAsymmetricCipherBase
    75 	public:
    89 	public:
    76 		/**
    90 		/**
    77 		Encrypts or decrypts aInput and appends the result to aOutput.
    91 		Encrypts or decrypts aInput and appends the result to aOutput.
    78 		@param aInput	The input data to be processed.
    92 		@param aInput	The input data to be processed.
    79 		@param aOutput	The resulting processed data appended to aOutput.
    93 		@param aOutput	The resulting processed data appended to aOutput.
       
    94 		@leave ...	Any of the crypto error codes defined in 
       
    95   					cryptospi_errs.h or any of the system-wide error codes.
    80 		*/
    96 		*/
    81 		virtual void ProcessL(const TDesC8& aInput, TDes8& aOutput) = 0;
    97 		virtual void ProcessL(const TDesC8& aInput, TDes8& aOutput) = 0;
    82 		};
    98 		};
    83 
    99 
    84 	class MAsyncAsymmetricCipher : public MAsymmetricCipherBase
   100 	class MAsyncAsymmetricCipher : public MAsymmetricCipherBase
    88 		/**
   104 		/**
    89 		Encrypts or decrypts aInput and appends the result to aOutput asynchronously
   105 		Encrypts or decrypts aInput and appends the result to aOutput asynchronously
    90 		@param aInput	The input data to be processed.
   106 		@param aInput	The input data to be processed.
    91 		@param aOutput	The resulting processed data appended to aOutput.
   107 		@param aOutput	The resulting processed data appended to aOutput.
    92 		@param aRequestStatus
   108 		@param aRequestStatus
       
   109 		@leave ...	Any of the crypto error codes defined in 
       
   110   					cryptospi_errs.h or any of the system-wide error codes.
    93 		*/
   111 		*/
    94 		virtual void ProcessL(const TDesC8& aInput, TDes8& aOutput, TRequestStatus& aRequestStatus) = 0;
   112 		virtual void ProcessL(const TDesC8& aInput, TDes8& aOutput, TRequestStatus& aRequestStatus) = 0;
    95 
   113 
    96 		/**
   114 		/**
    97 		Cancel the outstanding request
   115 		Cancel the outstanding request