CSenWsSecurityHeader Class Reference

#include <mw/SenWsSecurityHeader.h>

Link against: SenUtils.lib

class CSenWsSecurityHeader : public CSenBaseFragment

Inherits from

  • CSenWsSecurityHeader
    Public Member Enumerations
    enumTPasswordType { EText, EDigest }
    Public Member Functions
    virtual ~CSenWsSecurityHeader()
    IMPORT_C TIntBinarySecurityTokenL(const TDesC8 &, HBufC8 *&)
    IMPORT_C TIntBinarySecurityTokenL(const TDesC8 &, const TDesC8 &, HBufC8 *&)
    IMPORT_C CSenWsSecurityHeader *NewL()
    IMPORT_C CSenWsSecurityHeader *NewL(const TDesC8 &)
    IMPORT_C CSenWsSecurityHeader *NewL(const TDesC8 &, const TDesC8 &)
    IMPORT_C CSenWsSecurityHeader *NewLC()
    IMPORT_C CSenWsSecurityHeader *NewLC(const TDesC8 &)
    IMPORT_C CSenWsSecurityHeader *NewLC(const TDesC8 &, const TDesC8 &)
    IMPORT_C TIntTimestampL(const TDesC8 &, const TDesC8 &, HBufC8 *&)
    IMPORT_C TIntTimestampL(const TDesC8 &, HBufC8 *&)
    IMPORT_C HBufC8 *UsernameTokenL(CSenIdentityProvider &)
    IMPORT_C HBufC8 *UsernameTokenL(CSenIdentityProvider &, CSenWsSecurityHeader::TPasswordType)
    IMPORT_C TIntUsernameTokenL(const TDesC8 &, HBufC8 *&)
    IMPORT_C TIntUsernameTokenL(const TDesC8 &, const TDesC8 &, HBufC8 *&)
    IMPORT_C TIntUsernameTokenL(const TDesC8 &, const TDesC8 &, CSenWsSecurityHeader::TPasswordType, HBufC8 *&)
    virtual IMPORT_C TPtrC8XmlNs()
    virtual IMPORT_C TPtrC8XmlNsPrefix()
    Protected Member Functions
    CSenWsSecurityHeader()
    IMPORT_C voidBaseConstructL()
    IMPORT_C voidBaseConstructL(const TDesC8 &)
    IMPORT_C voidBaseConstructL(const TDesC8 &, const TDesC8 &)
    Inherited Attributes
    CSenBaseFragment::iState
    CSenBaseFragment::iWs
    CSenBaseFragment::iXmlReader
    CSenBaseFragment::ipElement
    CSenBaseFragment::ipOwner
    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()
    CSenBaseFragment::AllocContentSaverL()
    CSenBaseFragment::AsElement()
    CSenBaseFragment::AsXmlL()
    CSenBaseFragment::AsXmlUnicodeL()
    CSenBaseFragment::BaseConstructL(CSenXmlReader &)
    CSenBaseFragment::BaseConstructL(const CSenElement &)
    CSenBaseFragment::BaseConstructL(const TDesC8 &,const TDesC8 &,const TDesC8 &)
    CSenBaseFragment::BaseConstructL(const TDesC8 &,const TDesC8 &,const TDesC8 &,const RAttributeArray &)
    CSenBaseFragment::BaseConstructL(const TDesC8 &,const TDesC8 &,const TDesC8 &,const RAttributeArray &,CSenElement &)
    CSenBaseFragment::BuildFrom(const TDesC8 &)
    CSenBaseFragment::CSenBaseFragment()
    CSenBaseFragment::CharactersL(const TDesC8 &,TInt,TInt)
    CSenBaseFragment::ConsistsOfL(MSenFragment &)
    CSenBaseFragment::Content()
    CSenBaseFragment::ContentOf(const TDesC8 &)
    CSenBaseFragment::DelegateParsingL(MSenFragment &)
    CSenBaseFragment::DelegateParsingL(const TDesC8 &,const TDesC8 &,const TDesC8 &,const RAttributeArray &)
    CSenBaseFragment::DetachL()
    CSenBaseFragment::EndElementL(const TDesC8 &,const TDesC8 &,const TDesC8 &)
    CSenBaseFragment::EnsureNamespace(const TDesC8 &)
    CSenBaseFragment::ExtractElement()
    CSenBaseFragment::LocalName()const
    CSenBaseFragment::Namespace(const TDesC8 &)
    CSenBaseFragment::NewL(const CSenElement &)
    CSenBaseFragment::NewL(const TDesC8 &,const TDesC8 &,const TDesC8 &)
    CSenBaseFragment::NewL(const TDesC8 &,const TDesC8 &,const TDesC8 &,const RAttributeArray &)
    CSenBaseFragment::NewL(const TDesC8 &,const TDesC8 &,const TDesC8 &,const RAttributeArray &,CSenElement &)
    CSenBaseFragment::NsPrefix()const
    CSenBaseFragment::NsUri()const
    CSenBaseFragment::ParseL(const TDesC8 &)
    CSenBaseFragment::ParseWithL(CSenXmlReader &)
    CSenBaseFragment::Reader()
    CSenBaseFragment::ResetContentL()
    CSenBaseFragment::ResumeParsingFromL(const TDesC8 &,const TDesC8 &,const TDesC8 &)
    CSenBaseFragment::SaveNamespacesL(const RAttributeArray &,TBool)
    CSenBaseFragment::SetAttributesL(const RAttributeArray &)
    CSenBaseFragment::SetContentOfL(const TDesC8 &,const TDesC8 &)
    CSenBaseFragment::SetOwner(MSenFragment &)
    CSenBaseFragment::SetReader(CSenXmlReader &)
    CSenBaseFragment::StartElementL(const TDesC8 &,const TDesC8 &,const TDesC8 &,const RAttributeArray &)
    CSenBaseFragment::StartEntity(TDesC8 &)
    CSenBaseFragment::WriteAsXMLToL(RWriteStream &)
    CSenBaseFragment::WriteEndElementL(const TDesC8 &,const TDesC8 &,const TDesC8 &)
    CSenBaseFragment::WriteStartElementL(const TDesC8 &,const TDesC8 &,const TDesC8 &,const RAttributeArray &)
    CSenBaseFragment::~CSenBaseFragment()

    Detailed Description

    CSenWsSecurityHeader represents security header functionality according to oasis web services security (WSS) specifications (2004/01) or older (2003/06)
    Since
    Series60 3.0

    Member Enumeration Documentation

    Enum TPasswordType

    PasswordType Enumeration

    EnumeratorValueDescription
    EText1
    EDigest

    Constructor & Destructor Documentation

    CSenWsSecurityHeader ( )

    IMPORT_CCSenWsSecurityHeader()[protected]

    C++ default constructor

    ~CSenWsSecurityHeader ( )

    IMPORT_C~CSenWsSecurityHeader()[virtual]

    Destructor.

    Member Function Documentation

    BaseConstructL ( )

    IMPORT_C voidBaseConstructL()[protected]

    Basic BaseConstructL function

    BaseConstructL ( const TDesC8 & )

    IMPORT_C voidBaseConstructL(const TDesC8 &aData)[protected]

    Reimplemented from CSenBaseFragment::BaseConstructL(const TDesC8 &)

    From CSenBaseFragment Basic BaseConstructL function
    Since
    Series60 3.0
    ParameterDescription
    aDatawill be used as current token (content) of this security header

    BaseConstructL ( const TDesC8 &, const TDesC8 & )

    IMPORT_C voidBaseConstructL(const TDesC8 &aNsUri,
    const TDesC8 &aLocalName
    )[protected]

    Reimplemented from CSenBaseFragment::BaseConstructL(const TDesC8 &,const TDesC8 &)

    BaseConstructL offering possibility to set XML namespace and localname.
    Since
    Series60 3.0
    ParameterDescription
    aNsUriXML namespace URI for this fragment
    aLocalNameXML localname for this fragment

    BinarySecurityTokenL ( const TDesC8 &, HBufC8 *& )

    IMPORT_C TIntBinarySecurityTokenL(const TDesC8 &aContent,
    HBufC8 *&aToken
    )[static]
    Constructs a BinarySecurityToken.
    Since
    Series60 5.0
    ParameterDescription
    aContentEncoded EncryptedData which is to be used in token.
    aTokenRef-to-pointer where the token will be allocated. Shouldn't contain any data when called, or that data will be lost.

    Returns: KErrNone or some system-wide Symbian error code.

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

    IMPORT_C TIntBinarySecurityTokenL(const TDesC8 &aContent,
    const TDesC8 &aValueType,
    HBufC8 *&aToken
    )[static]
    Constructs a BinarySecurityToken.
    Since
    Series60 5.0
    ParameterDescription
    aContentEncoded EncryptedData which is to be used in token.
    aValueTypeIndicates what the security token is
    aTokenRef-to-pointer where the token will be allocated. Shouldn't contain any data when called, or that data will be lost.

    Returns: KErrNone or some system-wide Symbian error code.

    NewL ( )

    IMPORT_C CSenWsSecurityHeader *NewL()[static]

    Basic constructor.

    Returns: a pointer to new CSenWsSecurityHeader class instance.

    NewL ( const TDesC8 & )

    IMPORT_C CSenWsSecurityHeader *NewL(const TDesC8 &aData)[static]

    Reimplemented from CSenBaseFragment::NewL(const TDesC8 &)

    Basic constructor.

    ParameterDescription
    aDataData to be set as header's content.

    Returns: a pointer to new CSenWsSecurityHeader class instance.

    NewL ( const TDesC8 &, const TDesC8 & )

    IMPORT_C CSenWsSecurityHeader *NewL(const TDesC8 &aData,
    const TDesC8 &aSecurityNs
    )[static]

    Reimplemented from CSenBaseFragment::NewL(const TDesC8 &,const TDesC8 &)

    Basic constructor.

    ParameterDescription
    aDataData to be set as header's content.
    aSecurityNsA namespace to be set to the header.

    Returns: a pointer to new CSenWsSecurityHeader class instance.

    NewLC ( )

    IMPORT_C CSenWsSecurityHeader *NewLC()[static]

    Basic constructor.

    Returns: a new CSenWsSecurityHeader class instance, which pointer is left on cleanup stack.

    NewLC ( const TDesC8 & )

    IMPORT_C CSenWsSecurityHeader *NewLC(const TDesC8 &aData)[static]

    Basic constructor.

    ParameterDescription
    aDataData to be set as header's content.

    Returns: a new CSenWsSecurityHeader class instance, which pointer is left on cleanup stack.

    NewLC ( const TDesC8 &, const TDesC8 & )

    IMPORT_C CSenWsSecurityHeader *NewLC(const TDesC8 &aData,
    const TDesC8 &aSecurityNs
    )[static]

    Basic constructor.

    ParameterDescription
    aDataData to be set as header's content.
    aSecurityNsA namespace to be set to the header.

    Returns: a new CSenWsSecurityHeader class instance, which pointer is left on cleanup stack.

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

    IMPORT_C TIntTimestampL(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
    ParameterDescription
    aCreated- creation time of token
    aExpires- end of validation time for token
    aTimestamp- a pointer to buffer containing the timestamp. Does not return NULL. Ownership is transferred to the caller.

    Returns: KErrNone or some system-wide Symbian error code.

    TimestampL ( const TDesC8 &, HBufC8 *& )

    IMPORT_C TIntTimestampL(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
    ParameterDescription
    aCreated- creation time of token
    aTimestamp- a pointer to buffer containing the timestamp. Does not return NULL. Ownership is transferred to the caller.

    Returns: KErrNone or some system-wide Symbian error code.

    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.

    ParameterDescription
    aIdentityProviderIdentity 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:

    Returns: a pointer to buffer containing the username token. Does not return NULL. Ownership is transferred to the caller. Method leaves with value KErrNotSupported, if a password type is not supported.

    UsernameTokenL ( CSenIdentityProvider &, CSenWsSecurityHeader::TPasswordType )

    IMPORT_C HBufC8 *UsernameTokenL(CSenIdentityProvider &aIdentityProvider,
    CSenWsSecurityHeader::TPasswordTypeaType
    )
    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.

    ParameterDescription
    aIdentityProviderIdentity 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.
    aTypeSpecifies the type of the password, either wsse:PasswordText or wsse:PasswordDigest

    Returns: a pointer to buffer containing the username token. Does not return NULL. Ownership is transferred to the caller. Method leaves with value KErrNotSupported, if a password type is not supported.

    UsernameTokenL ( const TDesC8 &, HBufC8 *& )

    IMPORT_C TIntUsernameTokenL(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
    ParameterDescription
    aUsernameUser name which is used in the username token.
    aTokenRef-to-pointer where the token will be allocated. Shouldn't contain any data when called, or that data will be lost.

    Returns: KErrNone or some system-wide Symbian error code.

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

    IMPORT_C TIntUsernameTokenL(const TDesC8 &aUsername,
    const TDesC8 &aPassword,
    HBufC8 *&aToken
    )[static]
    Constructs a username token using a password, too.
    Since
    Series60 5.0
    ParameterDescription
    aUsernameUser name which is to be used in new token.
    aPasswordPassword 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.
    aTokenRef-to-pointer in which the token will be allocated. Shouldn't contain any data when called, or that data will be lost.

    Returns: KErrNone or some system-wide Symbian error code.

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

    IMPORT_C TIntUsernameTokenL(const TDesC8 &aUsername,
    const TDesC8 &aPassword,
    CSenWsSecurityHeader::TPasswordTypeaType,
    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>"

    ParameterDescription
    aUsernameUser name which is to be used in new token.
    aPasswordPassword which is to be use in new token This is a Base64 [XML-Schema] encoded, SHA-1 hash value, of the UTF8 encoded password.
    aTypeSpecifies 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:
    aTokenRef-to-pointer where the token will be allocated. Shouldn't contain any data when called, or that data will be lost.

    Returns: KErrNone or some system-wide Symbian error code.

    XmlNs ( )

    IMPORT_C TPtrC8XmlNs()[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

    Returns: KErrNone or some system-wide Symbian error code. Basic getter for XML namespace of the WS security header. Subclasses should override this to use different namespace the WS security header namespace as string

    XmlNsPrefix ( )

    IMPORT_C TPtrC8XmlNsPrefix()[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

    Returns: the WS security header namespace prefix as string