PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBCipherFactory
Wrapper Class for the ICipherFactory interface.
#include <SFBCipherFactory.h.hpp>
class SFBCipherFactory : public SFBQuery;
SFMTYPEDEFWRAPPER(SFBCipherFactory)

Inheritance diagram

 Inheritance diagram of SFBCipherFactoryClass

Version

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

Reference

BREW API ICipherFactory

Member

Public Functions
SFCError CreateCipher( AEECLSID clsid , SInt32 direction , AEECLSID mode , SInt32 padding , SFBCipher1SmpPtr cipher )
Creates a cipher with the specified characteristics.
SFCError CreateCipher2( CipherInfo * info , UInt32 size , SFBCipher1SmpPtr cipher )
Creates a cipher with the characteristics specified in a CipherInfo structure.
static
SFBCipherFactorySmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBCipherFactory instance.
SFCError QueryCipher( AEECLSID cipher , AEECLSID mode , SInt32 padding , SInt32 keysize )
Checks the factory to determine if a cipher with the specified characteristics can be created.
SFCError QueryInterface( AEECLSID clsid , VoidHandle handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFCError QueryInterface( AEECLSID clsid , SFBBaseSmpPtr handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFBBaseSmp QueryInterface( AEECLSID clsid ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
Void Self( AEECLSID clsidReq , SFBQuerySmpPtr clone , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
SFBQuerySmp Self( AEECLSID clsidReq , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
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.

SFBCipherFactory::CreateCipher
Creates a cipher with the specified characteristics.
[ public ]
SFCError CreateCipher(
    AEECLSID clsid            // Class ID of requested cipher algorithm 
    SInt32 direction          // encryption direction. See CIPHER_PARAM_DIRECTION under CIPHER_PARAM_XXX. 
    AEECLSID mode             // Class ID of requested block chaining mode algorithm. For stream ciphers this parameter should be 0
    SInt32 padding            // Type of padding to use for block ciphers. For stream ciphers or streaming block modes, this parameter is ignored. 
    SFBCipher1SmpPtr cipher   // pointer to returned ICipher1 handle 
);

Return value

  • SUCCESS: class created.
  • ENOMEMORY: insufficient memory.
  • ECLASSNOTSUPPORT: class specified is not supported.

Reference

BREW API ICIPHERFACTORY_CreateCipher


SFBCipherFactory::CreateCipher2
Creates a cipher with the characteristics specified in a CipherInfo structure.
[ public ]
SFCError CreateCipher2(
    CipherInfo * info         // Pointer to information on type of cipher to create. 
    UInt32 size               // Size of structure pointed to by pCipherInfo 
    SFBCipher1SmpPtr cipher   // pointer to returned ICipher1 handle 
);

Return value

  • SUCCESS: class created.
  • ENOMEMORY: insufficient memory.
  • ECLASSNOTSUPPORT: class(es) specified are not supported.
  • EBADPARM: invalid parameter or invalid field for CipherInfo.
  • AEE_CRYPT_INVALID_KEY: key is wrong length or otherwise invalid.

Description

Not all of the fields in CipherInfo are required for all ciphers. If the CipherInfo field cKey is zero or pKey is null, the key is not initialized. If the CipherInfo field cIV is zero or pIV is null, the IV is not initialized.

Reference

BREW API ICIPHERFACTORY_CreateCipher2


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

SFBCipherFactory::QueryCipher
Checks the factory to determine if a cipher with the specified characteristics can be created.
[ public ]
SFCError QueryCipher(
    AEECLSID cipher   // Class ID of requested cipher algorithm 
    AEECLSID mode     // Class ID of requested block chaining mode algorithm
    SInt32 padding    // Type of padding to use for block ciphers 
    SInt32 keysize    // Required key length in bytes 
);

Argument

cipher

Class ID of requested cipher algorithm.

mode

Class ID of requested block chaining mode algorithm. For stream ciphers this parameter is ignored and should be 0.

padding

Type of padding to use for block ciphers. For stream ciphers or streaming block modes, this parameter is ignored.

keysize

Required key length in bytes. Unless an unusual key length is required, this value may be 0 to skip this check.

Return value

  • SUCCESS: cipher can be created.
  • ENOMEMORY: insufficient memory.
  • ECLASSNOTSUPPORT: cipher is not supported as specified. This could mean that the algorithm is not available, the specific mode or padding is not supported or the key length is not supported.

Reference

BREW API ICIPHERFACTORY_QueryCipher