CSenWsSecurityHeader2 Class Reference

class CSenWsSecurityHeader2 : public CSenFragmentBase
CSenWsSecurityHeader represents security header functionality according to oasis web services security (WSS) specifications (2004/01) SenUtils.lib
Since
Series60 3.0

Inherits from

Public Member Functions
~CSenWsSecurityHeader2 ()
IMPORT_C CSenWsSecurityHeader2 * NewL ( RSenDocument , TXmlEngElement )
IMPORT_C CSenWsSecurityHeader2 * NewL (const TDesC8 &, RSenDocument , TXmlEngElement )
IMPORT_C CSenWsSecurityHeader2 * NewL (const TDesC8 &, const TDesC8 &, RSenDocument , TXmlEngElement )
IMPORT_C CSenWsSecurityHeader2 * NewLC ( RSenDocument , TXmlEngElement )
IMPORT_C CSenWsSecurityHeader2 * NewLC (const TDesC8 &, RSenDocument , TXmlEngElement )
IMPORT_C CSenWsSecurityHeader2 * NewLC (const TDesC8 &, const TDesC8 &, RSenDocument , TXmlEngElement )
IMPORT_C TInt TimestampL (const TDesC8 &, const TDesC8 &, HBufC8 *&)
IMPORT_C TInt TimestampL (const TDesC8 &, HBufC8 *&)
IMPORT_C HBufC8 * UsernameTokenL ( CSenIdentityProvider &)
IMPORT_C HBufC8 * UsernameTokenL ( CSenIdentityProvider &, CSenWsSecurityHeader2::TPasswordType )
IMPORT_C TInt UsernameTokenL (const TDesC8 &, HBufC8 *&)
IMPORT_C TInt UsernameTokenL (const TDesC8 &, const TDesC8 &, HBufC8 *&)
IMPORT_C TInt UsernameTokenL (const TDesC8 &, const TDesC8 &, CSenWsSecurityHeader2::TPasswordType , HBufC8 *&)
IMPORT_C TPtrC8 XmlNs ()
IMPORT_C TPtrC8 XmlNsPrefix ()
Protected Member Functions
CSenWsSecurityHeader2 ()
IMPORT_C void BaseConstructL ( RSenDocument , TXmlEngElement )
IMPORT_C void BaseConstructL (const TDesC8 &, RSenDocument , TXmlEngElement )
IMPORT_C void BaseConstructL (const TDesC8 &, const TDesC8 &, RSenDocument , TXmlEngElement )
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CSenFragmentBase::AddAttributesL(const RAttributeArray &)
CSenFragmentBase::AddAttributesToElementL(TXmlEngElement,const RAttributeArray &)
CSenFragmentBase::AddContentL(const TDesC8 &)
CSenFragmentBase::AddNamespacesL()
CSenFragmentBase::AsDocumentL()
CSenFragmentBase::AsElementL()
CSenFragmentBase::AsXmlL()
CSenFragmentBase::AsXmlUnicodeL()
CSenFragmentBase::BaseConstructL(TXmlEngElement &,RSenDocument &)
CSenFragmentBase::BaseConstructL(const TDesC8 &)
CSenFragmentBase::BaseConstructL(const TDesC8 &,const TDesC8 &)
CSenFragmentBase::BaseConstructL(const TDesC8 &,const TDesC8 &,const TDesC8 &)
CSenFragmentBase::BaseConstructL(const TDesC8 &,const TDesC8 &,const TDesC8 &,const RAttributeArray &)
CSenFragmentBase::BaseConstructL(const TDesC8 &,const TDesC8 &,const TDesC8 &,const RAttributeArray &,TXmlEngElement &)
CSenFragmentBase::BaseConstructL(const TDesC8 &,const TDesC8 &,const TDesC8 &,const RAttributeArray &,TXmlEngElement &,RSenDocument &)
CSenFragmentBase::BaseConstructL(const TXmlEngElement &)
CSenFragmentBase::CSenFragmentBase()
CSenFragmentBase::ConsistsOfL(CSenFragmentBase &)
CSenFragmentBase::ConsistsOfL(TXmlEngElement &,TXmlEngElement &)
CSenFragmentBase::ContentL()
CSenFragmentBase::ContentOf(const TDesC8 &)
CSenFragmentBase::ExtractElement()
CSenFragmentBase::GetExtendedInterface(const TInt32)
CSenFragmentBase::LocalName()const
CSenFragmentBase::Namespace(const TDesC8 &)
CSenFragmentBase::NewL(TXmlEngElement &,RSenDocument &)
CSenFragmentBase::NewL(const TDesC8 &)
CSenFragmentBase::NewL(const TDesC8 &,const TDesC8 &)
CSenFragmentBase::NewL(const TDesC8 &,const TDesC8 &,const TDesC8 &)
CSenFragmentBase::NewL(const TDesC8 &,const TDesC8 &,const TDesC8 &,const RAttributeArray &)
CSenFragmentBase::NewL(const TDesC8 &,const TDesC8 &,const TDesC8 &,const RAttributeArray &,TXmlEngElement &)
CSenFragmentBase::NewL(const TDesC8 &,const TDesC8 &,const TDesC8 &,const RAttributeArray &,TXmlEngElement &,RSenDocument &)
CSenFragmentBase::NewL(const TXmlEngElement &)
CSenFragmentBase::NsPrefix()const
CSenFragmentBase::NsUri()const
CSenFragmentBase::OnContentL(const TDesC8 &,TInt)
CSenFragmentBase::OnDelegateParsingL(CSenFragmentBase &)
CSenFragmentBase::OnDelegateParsingL(const RTagInfo &,const RAttributeArray &,TInt)
CSenFragmentBase::OnEndDocumentL(TInt)
CSenFragmentBase::OnEndElementL(const RTagInfo &,TInt)
CSenFragmentBase::OnEndPrefixMappingL(const RString &,TInt)
CSenFragmentBase::OnError(TInt)
CSenFragmentBase::OnIgnorableWhiteSpaceL(const TDesC8 &,TInt)
CSenFragmentBase::OnProcessingInstructionL(const TDesC8 &,const TDesC8 &,TInt)
CSenFragmentBase::OnResumeParsingFromL(const RTagInfo &,TInt)
CSenFragmentBase::OnSkippedEntityL(const RString &,TInt)
CSenFragmentBase::OnStartDocumentL(const RDocumentParameters &,TInt)
CSenFragmentBase::OnStartElementL(const RTagInfo &,const RAttributeArray &,TInt)
CSenFragmentBase::OnStartPrefixMappingL(const RString &,const RString &,TInt)
CSenFragmentBase::OnWriteEndElementL(const RTagInfo &)
CSenFragmentBase::OnWriteStartElementL(const RTagInfo &,const RAttributeArray &)
CSenFragmentBase::RenameL(const TDesC8 &,const TDesC8 &)
CSenFragmentBase::RenameL(const TDesC8 &,const TDesC8 &,const TDesC8 &)
CSenFragmentBase::RenameLocalNameL(const TDesC8 &)
CSenFragmentBase::RenameNamespaceL(const TDesC8 &)
CSenFragmentBase::RenameNamespaceL(const TDesC8 &,const TDesC8 &)
CSenFragmentBase::RenamePrefixL(const TDesC8 &)
CSenFragmentBase::ResetContentL()
CSenFragmentBase::SetContentHandler(CSenFragmentBase &)
CSenFragmentBase::SetContentL(const TDesC8 &)
CSenFragmentBase::SetContentOfL(const TDesC8 &,const TDesC8 &)
CSenFragmentBase::SetDocument(RSenDocument &)
CSenFragmentBase::SetOwner(CSenFragmentBase &)
CSenFragmentBase::StartSavingContent()
CSenFragmentBase::WriteAsXMLToL(RWriteStream &)
CSenFragmentBase::~CSenFragmentBase()
Public Member Enumerations
enum TPasswordType { EText  = 1, EDigest }
Inherited Attributes
CSenFragmentBase::iDocument
CSenFragmentBase::iElement
CSenFragmentBase::iState
CSenFragmentBase::ipContentBuf
CSenFragmentBase::ipContentWriteStream
CSenFragmentBase::ipDelegate
CSenFragmentBase::ipNamespaceArray
CSenFragmentBase::ipOwner
CSenFragmentBase::ipParser

Constructor & Destructor Documentation

CSenWsSecurityHeader2()

IMPORT_C CSenWsSecurityHeader2 ( ) [protected]

C++ default constructor

~CSenWsSecurityHeader2()

IMPORT_C ~CSenWsSecurityHeader2 ( ) [virtual]

Destructor.

Member Functions Documentation

BaseConstructL(RSenDocument, TXmlEngElement)

IMPORT_C void BaseConstructL ( RSenDocument aDocument,
TXmlEngElement aElement
) [protected]

Basic BaseConstructL function

Parameters

RSenDocument aDocument
TXmlEngElement aElement

BaseConstructL(const TDesC8 &, RSenDocument, TXmlEngElement)

IMPORT_C void BaseConstructL ( const TDesC8 & aData,
RSenDocument aDocument,
TXmlEngElement aElement
) [protected]
From CSenBaseFragment Basic BaseConstructL function
Since
Series60 3.0

Parameters

const TDesC8 & aData Data which will be used as current token (content) of this security header
RSenDocument aDocument The document which will be the owner of the elements of this header
TXmlEngElement aElement An element which will be parent for this header.

BaseConstructL(const TDesC8 &, const TDesC8 &, RSenDocument, TXmlEngElement)

IMPORT_C void BaseConstructL ( const TDesC8 & aData,
const TDesC8 & aSecurityNs,
RSenDocument aDocument,
TXmlEngElement aElement
) [protected]
From CSenBaseFragment Basic BaseConstructL function
Since
Series60 3.0

Parameters

const TDesC8 & aData Data which will be used as current token (content) of this security header
const TDesC8 & aSecurityNs A namespace to be set to the header.
RSenDocument aDocument The document which will be the owner of the elements of this header
TXmlEngElement aElement An element which will be parent for this header.

NewL(RSenDocument, TXmlEngElement)

IMPORT_C CSenWsSecurityHeader2 * NewL ( RSenDocument aDocument,
TXmlEngElement aElement
) [static]

Basic constructor

Parameters

RSenDocument aDocument The document which will be the owner of the elements of this header
TXmlEngElement aElement An element which will be parent for this header.

NewL(const TDesC8 &, RSenDocument, TXmlEngElement)

IMPORT_C CSenWsSecurityHeader2 * NewL ( const TDesC8 & aData,
RSenDocument aDocument,
TXmlEngElement aElement
) [static]

Basic constructor.

Parameters

const TDesC8 & aData Data to be set as header's content.
RSenDocument aDocument The document which will be the owner of the elements of this header
TXmlEngElement aElement An element which will be parent for this header.

NewL(const TDesC8 &, const TDesC8 &, RSenDocument, TXmlEngElement)

IMPORT_C CSenWsSecurityHeader2 * NewL ( const TDesC8 & aData,
const TDesC8 & aSecurityNs,
RSenDocument aDocument,
TXmlEngElement aElement
) [static]

Basic constructor.

Parameters

const TDesC8 & aData Data to be set as header's content.
const TDesC8 & aSecurityNs A namespace to be set to the header.
RSenDocument aDocument The document which will be the owner of the elements of this header
TXmlEngElement aElement An element which will be parent for this header.

NewLC(RSenDocument, TXmlEngElement)

IMPORT_C CSenWsSecurityHeader2 * NewLC ( RSenDocument aDocument,
TXmlEngElement aElement
) [static]

Basic constructor.

Parameters

RSenDocument aDocument The document which will be the owner of the elements of this header
TXmlEngElement aElement An element which will be parent for this header.

NewLC(const TDesC8 &, RSenDocument, TXmlEngElement)

IMPORT_C CSenWsSecurityHeader2 * NewLC ( const TDesC8 & aData,
RSenDocument aDocument,
TXmlEngElement aElement
) [static]

Basic constructor.

Parameters

const TDesC8 & aData Data to be set as header's content.
RSenDocument aDocument The document which will be the owner of the elements of this header
TXmlEngElement aElement An element which will be parent for this header.

NewLC(const TDesC8 &, const TDesC8 &, RSenDocument, TXmlEngElement)

IMPORT_C CSenWsSecurityHeader2 * NewLC ( const TDesC8 & aData,
const TDesC8 & aSecurityNs,
RSenDocument aDocument,
TXmlEngElement aElement
) [static]

Basic constructor.

Parameters

const TDesC8 & aData Data to be set as header's content.
const TDesC8 & aSecurityNs A namespace to be set to the header.
RSenDocument aDocument The document which will be the owner of the elements of this header
TXmlEngElement aElement An element which will be parent for this header.

TimestampL(const TDesC8 &, const TDesC8 &, HBufC8 *&)

IMPORT_C TInt TimestampL ( const TDesC8 & aCreated,
const TDesC8 & aExpires,
HBufC8 *& aTimestamp
) [static]
Constructs a timestamp.
Since
Series60 5.0 Format of the timestamp is as follows: <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsu:Created>2001-09-13T08:42:00Z</wsu:Created> <wsu:Expires>2002-09-13T08:42:00Z</wsu:Expires> </wsu:Timestamp> The wsu namespace is declared inside this element. Based on chapter 10 from WS-Security 2004

Parameters

const TDesC8 & aCreated - creation time of token
const TDesC8 & aExpires - end of validation time for token
HBufC8 *& aTimestamp - a pointer to buffer containing the timestamp. Does not return NULL. Ownership is transferred to the caller.

TimestampL(const TDesC8 &, HBufC8 *&)

IMPORT_C TInt TimestampL ( const TDesC8 & aCreated,
HBufC8 *& aTimestamp
) [static]
Constructs a timestamp.
Since
Series60 5.0 Format of the timestamp is as follows: <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsu:Created>2001-09-13T08:42:00Z</wsu:Created> </wsu:Timestamp> The wsu namespace is declared inside this element. Based on chapter 10 from WS-Security 2004

Parameters

const TDesC8 & aCreated - creation time of token
HBufC8 *& aTimestamp - a pointer to buffer containing the timestamp. Does not return NULL. Ownership is transferred to the caller.

UsernameTokenL(CSenIdentityProvider &)

IMPORT_C HBufC8 * UsernameTokenL ( CSenIdentityProvider & aIdentityProvider )
Constructs a username token.
Since
Series60 3.0
<wsse:UsernameToken> <wsse:Username> username </wsse:Username> </wsse:UsernameToken>"

The above token assumes, that wsse namespace is declared in top level of the security header.

Parameters

CSenIdentityProvider & aIdentityProvider Identity provider which is used to get the authorization ID used in username token. Method takes the AuthzID out from aIdentityProvider, and uses it as username for this token. Format of the token is as follows:

UsernameTokenL(CSenIdentityProvider &, CSenWsSecurityHeader2::TPasswordType)

IMPORT_C HBufC8 * UsernameTokenL ( CSenIdentityProvider & aIdentityProvider,
CSenWsSecurityHeader2::TPasswordType aType
)
Constructs a username token.
Since
Series60 3.0
Format of the token is as follows (if password type is wsse:PasswordText):

<wsse:UsernameToken> <wsse:Username> username </wsse:Username> <wsse:Password> password </wsse:Password> </wsse:UsernameToken>"

If the password type is wsse:Password:Digest, then the password element will be declared as follows:

<wsse:Password Type="wsse:PasswordDigest">

The above token assumes, that wsse namespace is declared in top level of the security header.

Parameters

CSenIdentityProvider & aIdentityProvider Identity provider which is used to get the authorization ID used in username token. Method takes the AuthzID out from aIdentityProvider, and uses it as username for this token. Password is also fetched from aIdentityProvider via calling Password() getter, which must return a Base64 [XML-Schema] encoded, SHA-1 hash value, of the UTF8 encoded password.
CSenWsSecurityHeader2::TPasswordType aType Specifies the type of the password, either wsse:PasswordText or wsse:PasswordDigest

UsernameTokenL(const TDesC8 &, HBufC8 *&)

IMPORT_C TInt UsernameTokenL ( const TDesC8 & aUsername,
HBufC8 *& aToken
) [static]
Constructs a username token. This method does not add the <Password> element, since it is optional for basic username tokens.
Since
Series60 3.0

Parameters

const TDesC8 & aUsername User name which is used in the username token.
HBufC8 *& aToken Ref-to-pointer where the token will be allocated. Shouldn't contain any data when called, or that data will be lost.

UsernameTokenL(const TDesC8 &, const TDesC8 &, HBufC8 *&)

IMPORT_C TInt UsernameTokenL ( const TDesC8 & aUsername,
const TDesC8 & aPassword,
HBufC8 *& aToken
) [static]
Constructs a username token using a password, too.
Since
Series60 5.0

Parameters

const TDesC8 & aUsername User name which is to be used in new token.
const TDesC8 & aPassword Password which is to be use in new token. The type will be set to default: wsse:PasswordDigest, defined in KSecurityAttrTypeText. This is a Base64 [XML-Schema] encoded, SHA-1 hash value, of the UTF8 encoded password.
HBufC8 *& aToken Ref-to-pointer in which the token will be allocated. Shouldn't contain any data when called, or that data will be lost.

UsernameTokenL(const TDesC8 &, const TDesC8 &, CSenWsSecurityHeader2::TPasswordType, HBufC8 *&)

IMPORT_C TInt UsernameTokenL ( const TDesC8 & aUsername,
const TDesC8 & aPassword,
CSenWsSecurityHeader2::TPasswordType aType,
HBufC8 *& aToken
) [static]
Constructs a username token using a password, too.
Since
Series60 5.0
<wsse:UsernameToken> <wsse:Username> username </wsse:Username> <wsse:Password Type="wsse:PasswordDigest"> password </wsse:Password> </wsse:UsernameToken>"

Parameters

const TDesC8 & aUsername User name which is to be used in new token.
const TDesC8 & aPassword Password which is to be use in new token This is a Base64 [XML-Schema] encoded, SHA-1 hash value, of the UTF8 encoded password.
CSenWsSecurityHeader2::TPasswordType aType Specifies the type of the password:EText, being default refers to wsse:PasswordText, but this method does not add this, since it can be omitted.EDigest: will add wsse:PasswordDigest attribute to the <Password> -element, as in here:
HBufC8 *& aToken Ref-to-pointer where the token will be allocated. Shouldn't contain any data when called, or that data will be lost.

XmlNs()

IMPORT_C TPtrC8 XmlNs ( ) [virtual]
Constructs a security token reference.
Since
Series60 5.0 Format of the token reference is as follows: <wsse:SecurityTokenReference wsu:Id="..."> <wsse:Reference URI="..."/> </wsse:SecurityTokenReference>
The above token assumes, that wsse namespace is declared in top level of the security header.
Since
Series60 3.0

XmlNsPrefix()

IMPORT_C TPtrC8 XmlNsPrefix ( ) [virtual]
Basic getter for XML namespace prefix of the WS security header. Subclasses should override this to use different namespace prefix
Since
Series60 3.0

Member Enumerations Documentation

Enum TPasswordType

PasswordType Enumeration

Enumerators

EText = 1
EDigest