Bayonne2 / Common C++ 2 Framework
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
ZrtpUserCallback Class Reference

Application callback methods. More...

#include <ZrtpUserCallback.h>

Public Member Functions

 ZrtpUserCallback ()
 Create the stadard user callback class. More...
 
virtual ~ZrtpUserCallback ()
 
virtual void secureOn (std::string cipher)
 Inform user interface that security is active now. More...
 
virtual void secureOff ()
 Inform user interface that security is not active any more. More...
 
virtual void showSAS (std::string sas, bool verified)
 Show the Short Authentication String (SAS) on user interface. More...
 
virtual void confirmGoClear ()
 Inform the user that ZRTP received "go clear" message from its peer. More...
 
virtual void showMessage (GnuZrtpCodes::MessageSeverity sev, int32_t subCode)
 Show some information to user. More...
 
virtual void zrtpNegotiationFailed (GnuZrtpCodes::MessageSeverity severity, int32_t subCode)
 ZRTPQueue calls this if the negotiation failed. More...
 
virtual void zrtpNotSuppOther ()
 ZRTPQueue calls this method if the other side does not support ZRTP. More...
 
virtual void zrtpAskEnrollment (GnuZrtpCodes::InfoEnrollment info)
 ZRTPQueue calls this method to inform about a PBX enrollment request. More...
 
virtual void zrtpInformEnrollment (GnuZrtpCodes::InfoEnrollment info)
 ZRTPQueue calls this method to inform about PBX enrollment result. More...
 
virtual void signSAS (uint8_t *sasHash)
 ZRTPQueue calls this method to request a SAS signature. More...
 
virtual bool checkSASSignature (uint8_t *sasHash)
 ZRTPQueue calls this method to request a SAS signature check. More...
 

Detailed Description

Application callback methods.

The ccRTP specific part of GNU ZRTP uses these callback methods to report ZRTP events to the application. This class implements a default behaviour for each callback method, usually just a return.

An application may extend this class and overload methods to implement its own behaviour. The application must register its callback class using ZrtpQueue::setUserCallback().

CAVEAT
All methods of the user callback class and classes that extend this class run in the context of the RTP thread. Thus it is of paramount importance to keep the execution time of the methods as short as possible.

Author
Werner Dittmann Werne.nosp@m.r.Di.nosp@m.ttman.nosp@m.n@t-.nosp@m.onlin.nosp@m.e.de

Definition at line 54 of file ZrtpUserCallback.h.

Constructor & Destructor Documentation

ZrtpUserCallback::ZrtpUserCallback ( )
inline

Create the stadard user callback class.

Definition at line 59 of file ZrtpUserCallback.h.

virtual ZrtpUserCallback::~ZrtpUserCallback ( )
inlinevirtual

Definition at line 61 of file ZrtpUserCallback.h.

Member Function Documentation

virtual bool ZrtpUserCallback::checkSASSignature ( uint8_t *  sasHash)
inlinevirtual

ZRTPQueue calls this method to request a SAS signature check.

After ZRTP received a SAS signature in one of the Confirm packets it call this method. The client may use getSignatureLength() and getSignatureData()of ZrtpQueue to get the signature data and perform the signature check. Refer to chapter 8.2 of ZRTP specification.

If the signature check fails the client may return false to ZRTP. In this case ZRTP signals an error to the other peer and terminates the ZRTP handshake.

Parameters
sasHashPointer to the 32 byte SAS hash that was signed by the other peer.
Returns
true if the signature was ok, false otherwise.

Definition at line 229 of file ZrtpUserCallback.h.

virtual void ZrtpUserCallback::confirmGoClear ( )
inlinevirtual

Inform the user that ZRTP received "go clear" message from its peer.

On receipt of a go clear message the user is requested to confirm a switch to unsecure (clear) modus. Until the user confirms ZRTP (and the underlying RTP) does not send any data.

Definition at line 111 of file ZrtpUserCallback.h.

virtual void ZrtpUserCallback::secureOff ( )
inlinevirtual

Inform user interface that security is not active any more.

ZRTP calls this method if either the sender or the receiver left secure mode.

Definition at line 82 of file ZrtpUserCallback.h.

virtual void ZrtpUserCallback::secureOn ( std::string  cipher)
inlinevirtual

Inform user interface that security is active now.

ZRTP calls this method if the sender and the receiver are in secure mode now.

Parameters
cipherName and mode of cipher used to encrypt the SRTP stream

Definition at line 72 of file ZrtpUserCallback.h.

virtual void ZrtpUserCallback::showMessage ( GnuZrtpCodes::MessageSeverity  sev,
int32_t  subCode 
)
inlinevirtual

Show some information to user.

ZRTP calls this method to display some information to the user. Along with the message ZRTP provides a severity indicator that defines: Info, Warning, Error, and Alert. Refer to the MessageSeverity enum in ZrtpCodes.h. The UI may use this indicator to highlight messages or alike.

Parameters
sevSeverity of the message.
subCodeThe subcode identifying the reason.

Definition at line 129 of file ZrtpUserCallback.h.

virtual void ZrtpUserCallback::showSAS ( std::string  sas,
bool  verified 
)
inlinevirtual

Show the Short Authentication String (SAS) on user interface.

ZRTP calls this method to display the SAS and inform about the SAS verification status. The user interface shall enable a SAS verfication button (or similar UI element). The user shall click on this UI element after he/she confirmed the SAS code with the partner.

Parameters
sasThe string containing the SAS.
verifiedIf verified is true then SAS was verified by both parties during a previous call, otherwise it is set to false.

Definition at line 100 of file ZrtpUserCallback.h.

virtual void ZrtpUserCallback::signSAS ( uint8_t *  sasHash)
inlinevirtual

ZRTPQueue calls this method to request a SAS signature.

After ZRTP core was able to compute the Short Authentication String (SAS) it calls this method. The client may now use an approriate method to sign the SAS. The client may use setSignatureData() of ZrtpQueue to store the signature data an enable signature transmission to the other peer. Refer to chapter 8.2 of ZRTP specification.

Parameters
sasHashPointer to the 32 byte SAS hash to be signed.
See Also
ZrtpQueue::setSignatureData

Definition at line 206 of file ZrtpUserCallback.h.

virtual void ZrtpUserCallback::zrtpAskEnrollment ( GnuZrtpCodes::InfoEnrollment  info)
inlinevirtual

ZRTPQueue calls this method to inform about a PBX enrollment request.

Please refer to chapter 8.3 ff to get more details about PBX enrollment and SAS relay.

Parameters
infoGive some information to the user about the PBX requesting an enrollment.

Definition at line 172 of file ZrtpUserCallback.h.

virtual void ZrtpUserCallback::zrtpInformEnrollment ( GnuZrtpCodes::InfoEnrollment  info)
inlinevirtual

ZRTPQueue calls this method to inform about PBX enrollment result.

Informs the use about the acceptance or denial of an PBX enrollment request

Parameters
infoGive some information to the user about the result of an enrollment.

Definition at line 187 of file ZrtpUserCallback.h.

virtual void ZrtpUserCallback::zrtpNegotiationFailed ( GnuZrtpCodes::MessageSeverity  severity,
int32_t  subCode 
)
inlinevirtual

ZRTPQueue calls this if the negotiation failed.

ZRTPQueue calls this method in case ZRTP negotiation failed. The parameters show the severity as well as some explanatory text. Refer to the MessageSeverity enum above.

Parameters
severityThis defines the message's severity
subCodeThe subcode identifying the reason.

Definition at line 145 of file ZrtpUserCallback.h.

virtual void ZrtpUserCallback::zrtpNotSuppOther ( )
inlinevirtual

ZRTPQueue calls this method if the other side does not support ZRTP.

If the other side does not answer the ZRTP Hello packets then ZRTP calls this method.

Definition at line 157 of file ZrtpUserCallback.h.


The documentation for this class was generated from the following file: