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

Inheritance diagram

 Inheritance diagram of SFBPubKeyUtilClass

Version

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

Reference

BREW API IPubKeyUtil

Member

Public Functions
SFCError AddOIDMapping( UInt32 uOID , AEECLSID clsid , SInt32 padType )
This function can be used to add OID mappings. OID mappings added using this will overwrite the prior mapping added using this interface.
SFCError Hash( SFBxOptsSmpConstRef opts , UInt32 uOID , UInt08ConstPtr in , SInt32 inLen , UInt08Ptr hashBuffer , SInt32Ptr hashLen , SInt32Ptr sigType )
Hash the input data using the hash OID provided in uOID and stores the output in hashBuffer.
SFCError Hash( SFBxOptsSmpConstRef opts , UInt32 uOID , SFXBufferConstRef in , SFXBufferPtr hashBuffer , SInt32Ptr sigType )
Hash the input data using the hash OID provided in uOID and stores the output in hashBuffer.
SFCError LookupOIDMapping( UInt32 uOID , UInt32Ptr hashCTXClassId , SInt32Ptr paddingType )
look up OID mappings
static
SFBPubKeyUtilSmp
NewInstance( SFCErrorPtr exception = null )
Create a new SFBPubKeyUtil instance.
static
SFBPubKeyUtilSmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBPubKeyUtil instance.
SFCError Parse( SInt32 type , UInt08ConstPtr pIn , SInt32 inLen , SFBParametersPtr result )
Parse a key format of type Type pointed to by pIn with total length of InLen.
SFCError Serialize( SInt32 type , SFBParametersConstRef pIn , UInt08Ptr pOut , SInt32Ptr outLen )
Serializes the key material stored in pIn to key format specified by Type, stores the output in buffer pointed by pOut, and updates the size in pOutLen.
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.

SFBPubKeyUtil::AddOIDMapping
This function can be used to add OID mappings. OID mappings added using this will overwrite the prior mapping added using this interface.
[ public ]
SFCError AddOIDMapping(
    UInt32 uOID      // unique OID
    AEECLSID clsid   // class ID of context implementing/supporting this algorithm 
    SInt32 padType   // one of the well defined signature / padding types 
);

Return value

  • AEE_SUCCESS: Parse completed successfully
  • AEE_ENOMEMORY: Out of memory
  • AEE_EUNSUPPORTED:Function not implemented in this class

Reference

BREW API IPubKeyUtil_AddOIDMapping


SFBPubKeyUtil::Hash
Hash the input data using the hash OID provided in uOID and stores the output in hashBuffer.
[ public ]
SFCError Hash(
    SFBxOptsSmpConstRef opts   // xOpts passed in
    UInt32 uOID                // unique OID of Hash Algorithm to use
    UInt08ConstPtr in          // data to be hashed
    SInt32 inLen               // length of data to be hashed
    UInt08Ptr hashBuffer       // buffer where hashed data is copied out
    SInt32Ptr hashLen          // return the length of the hash buf
    SInt32Ptr sigType          // return one of the sigType
);
[ public ]
SFCError Hash(
    SFBxOptsSmpConstRef opts   // xOpts passed in
    UInt32 uOID                // unique OID of Hash Algorithm to use
    SFXBufferConstRef in       // data to be hashed
    SFXBufferPtr hashBuffer    // buffer where hashed data is copied out
    SInt32Ptr sigType          // return one of the sigType
);

Reference

BREW API IPubKeyUtil_Hash


SFBPubKeyUtil::LookupOIDMapping
look up OID mappings
[ public ]
SFCError LookupOIDMapping(
    UInt32 uOID                // unique OID
    UInt32Ptr hashCTXClassId   // place to store class ID of context implementing/supporting this algorithm. May be null
    SInt32Ptr paddingType      // place to store signature/padding types. May be null
);

Reference

BREW API IPubKeyUtil_LookupOIDMapping


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

SFBPubKeyUtil::Parse
Parse a key format of type Type pointed to by pIn with total length of InLen.
[ public ]
SFCError Parse(
    SInt32 type               // encoding type to parse 
    UInt08ConstPtr pIn        // pointer to encoded data 
    SInt32 inLen              // size of encoded data 
    SFBParametersPtr result   // interface pointer where parsed data is to be stored if operation is successful
);

Return value

  • SUCCESS: Parse completed successfully
  • EBADPARM: Invalid parameter

Defined values for parameter nType:

IPUBKEYUTIL_ASN1: Any key in ASN.1 format that the parser knows about. OIDs are used to distinguish key types.

Other implementations may define other types.

Reference

BREW API IPubKeyUtil_Parse


SFBPubKeyUtil::Serialize
Serializes the key material stored in pIn to key format specified by Type, stores the output in buffer pointed by pOut, and updates the size in pOutLen.
[ public ]
SFCError Serialize(
    SInt32 type                 // encoding type to generate 
    SFBParametersConstRef pIn   // interface pointer of input 
    UInt08Ptr pOut              // pointer where encoded data is to be stored if operation is successful. Buffer is caller provided
    SInt32Ptr outLen            // Pointer to the full length of the parameter data
);

Return value

  • SUCCESS: Parse completed successfully
  • EBADPARM: Invalid parameter
  • AEE_EUNSUPPORTED: Function not implemented in this class

See SFBPubKeyUtilParse() for possible values for parameter nType.