PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBRSA
Wrapper Class for the IRSA interface.
#include <SFBRSA.h.hpp>
class SFBRSA : public SFBBase;
SFMTYPEDEFWRAPPER(SFBRSA)

Inheritance diagram

 Inheritance diagram of SFBRSAClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
O O O O

Reference

BREW API IRSA

Member

Public Functions
Void Decrypt( VoidConstPtr in , SInt32 inLength , VoidPtr out , SInt32Ptr outLength , SInt32 pad , UInt32Ptr result , SFXCallbackPtr callback )
Decrypt given data.
Void Decrypt( SFXBufferConstRef in , SFXBufferPtr out , SInt32Ptr outLength , SInt32 pad , UInt32Ptr result , SFXCallbackPtr callback )
Decrypt given data.
Void Encrypt( VoidConstPtr in , SInt32 inLength , VoidPtr out , SInt32Ptr outLength , SInt32 pad , UInt32Ptr result , SFXCallbackPtr callback )
Encrypt given data.
Void Encrypt( SFXBufferConstRef in , SFXBufferPtr out , SInt32Ptr outLength , SInt32 pad , UInt32Ptr result , SFXCallbackPtr callback )
Encrypt given data.
SFCError Init( VoidConstPtr modulus , SInt32 modSize , VoidConstPtr exponent , SInt32 expSize )
Initialize with key for RSA or modular exponentiation operation.
SFCError Init( SFXBufferConstRef modulus , SFXBufferConstRef exponent )
Initialize with key for RSA or modular exponentiation operation.
Void ModExp( VoidConstPtr in , SInt32 inLength , VoidHandle out , SInt32Ptr outLength , UInt32Ptr result , SFXCallbackPtr callback )
This performs modular exponentiation, the basic operation for the RSA algorithm. This is a non-blocking replacement for SFBRSA::RSA(). Now, this API is running in blocking mode.
static
SFBRSASmp
NewInstance( SFCErrorPtr exception = null )
Create a new SFBRSA instance.
static
SFBRSASmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBRSA instance.
SFCError RSA( VoidConstPtr in , SInt32 available , VoidHandle out , SInt32Ptr outSize , SInt32 reserved )
Obsoleted interface that performs modular exponentiation with the initialized key.
Void VerifySig( VoidConstPtr sig , SInt32 sigLength , VoidConstPtr digest , SInt32 digestLength , SInt32 type , UInt32Ptr result , SFXCallbackPtr callback )
Verify a PKCS1 format signature.
Void VerifySig( SFXBufferConstRef sig , SFXBufferConstRef digest , SInt32 type , UInt32Ptr result , SFXCallbackPtr callback )
Verify a PKCS1 format signature.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBRSA::Decrypt
Decrypt given data.
[ public ]
Void Decrypt(
    VoidConstPtr in           // pointer to buffer of data to decrypt 
    SInt32 inLength           // length of input buffer 
    VoidPtr out               // pointer to buffer to store encrpypted data, caller allocated 
    SInt32Ptr outLength       // length of output buffer on input, length of data on output 
    SInt32 pad                // type of padding to use 
    UInt32Ptr result          // result code 
    SFXCallbackPtr callback   // completion callback 
);
[ public ]
Void Decrypt(
    SFXBufferConstRef in      // pointer to buffer of data to decrypt
    SFXBufferPtr out          // pointer to buffer to store encrpypted data 
    SInt32Ptr outLength       // length of output buffer on input, length of data on output 
    SInt32 pad                // type of padding to use 
    UInt32Ptr result          // result code 
    SFXCallbackPtr callback   // completion callback 
);

Description

Warning: As the argument called by API is SInt32, the buffer size can not over the limit of a SInt32 value.

Reference

BREW API IRSA_Decrypt


SFBRSA::Encrypt
Encrypt given data.
[ public ]
Void Encrypt(
    VoidConstPtr in           // pointer to buffer of data to encrypt 
    SInt32 inLength           // length of input buffer 
    VoidPtr out               // pointer to buffer to store encrpypted data, caller allocated 
    SInt32Ptr outLength       // length of output buffer on input, length of data on output 
    SInt32 pad                // type of padding to use 
    UInt32Ptr result          // result code 
    SFXCallbackPtr callback   // completion callback 
);
[ public ]
Void Encrypt(
    SFXBufferConstRef in      // pointer to buffer of data to encrypt 
    SFXBufferPtr out          // pointer to buffer to store encrpypted data 
    SInt32Ptr outLength       // length of output buffer on input, length of data on output 
    SInt32 pad                // type of padding to use 
    UInt32Ptr result          // result code 
    SFXCallbackPtr callback   // completion callback 
);

Description

Warning: As the argument called by API is SInt32, the buffer size can not over the limit of a SInt32 value.

Reference

BREW API IRSA_Encrypt


SFBRSA::Init
Initialize with key for RSA or modular exponentiation operation.
[ public ]
SFCError Init(
    VoidConstPtr modulus    // pointer to modulus 
    SInt32 modSize          // modulus size in bytes 
    VoidConstPtr exponent   // pointer to public or private exponent
    SInt32 expSize          // public or Private exponent size in bytes 
);
[ public ]
SFCError Init(
    SFXBufferConstRef modulus    // buffer containing modulus
    SFXBufferConstRef exponent   // buffer containing Public or Private exponent
);

Reference

BREW API IRSA_Init


SFBRSA::ModExp
This performs modular exponentiation, the basic operation for the RSA algorithm. This is a non-blocking replacement for SFBRSA::RSA(). Now, this API is running in blocking mode.
[ public ]
Void ModExp(
    VoidConstPtr in           // pointer to the input buffer 
    SInt32 inLength           // length of the input data 
    VoidHandle out            // pointer to the internal result buffer 
    SInt32Ptr outLength       // length of the resulting data 
    UInt32Ptr result          // storage for the result of the operation 
    SFXCallbackPtr callback   // user defined callback to call when complete 
);

Description

Warning: As the argument called by API is SInt32, the buffer size can not over the limit of a SInt32 value.

Version

Supported in BREW 2.1 or later.

Reference

BREW API IRSA_ModExp


SFBRSA::NewInstance
Create a new SFBRSA instance.
[ public, static ]
SFBRSASmp NewInstance(
    SFCErrorPtr exception = null   // Error
);
[ public, static ]
SFBRSASmp NewInstance(
    AEECLSID id                    // Class ID
    SFCErrorPtr exception = null   // Error
);

SFBRSA::RSA
Obsoleted interface that performs modular exponentiation with the initialized key.
[ public ]
SFCError RSA(
    VoidConstPtr in     // pointer to data to be encrypted/decrypted 
    SInt32 available    // input data size in bytes 
    VoidHandle out      // buffer containing encrypted/decrypted data 
    SInt32Ptr outSize   // size of output in bytes 
    SInt32 reserved     // should be 0 
);

Reference

BREW API IRSA_RSA


SFBRSA::VerifySig
Verify a PKCS1 format signature.
[ public ]
Void VerifySig(
    VoidConstPtr sig          // pointer to a buffer containing a signature 
    SInt32 sigLength          // the length of the signature 
    VoidConstPtr digest       // pointer to a buffer containing the expected digest 
    SInt32 digestLength       // the length of the digest 
    SInt32 type               // one of AEE_RSA_SIG_ 
    UInt32Ptr result          // a result code 
    SFXCallbackPtr callback   // pointer to a user defined callback routine 
);
[ public ]
Void VerifySig(
    SFXBufferConstRef sig      // pointer to a buffer containing a signature
    SFXBufferConstRef digest   // pointer to a buffer containing the expected digest 
    SInt32 type                // one of AEE_RSA_SIG_ 
    UInt32Ptr result           // a result code 
    SFXCallbackPtr callback    // pointer to a user defined callback routine 
);

Reference

BREW API IRSA_VerifySig