SAP ABAP Class CL_ABAP_HMAC (Message Authentication Code (MAC) of a message)
Hierarchy
☛
SAP_BASIS (Software Component) SAP Basis Component
⤷
BC-SEC (Application Component) Security
⤷
SECH (Package) Security: MD5-Hash (Copyright by RSA Data Security, Inc)
⤷
⤷
Properties
| Class | CL_ABAP_HMAC | |
| Short Description | Message Authentication Code (MAC) of a message | |
| Super Class | ||
| Instantiability of a Class | 0 | Private |
| Final |
General Data
| Message Class | MD5 | |
| Program status | S | System Program |
| Category | 0 | |
| Package | SECH | Security: MD5-Hash (Copyright by RSA Data Security, Inc) |
| Created | 20100305 | SAP |
| Last change | 20110908 | SAP |
| Shared Memory-enabled | ||
| Fixed point arithmetic | ||
| Unicode checks active |
Forward declarations
| # | Type group / Object type | Type | Type Description |
|---|---|---|---|
| 1 | Type group use (TYPE-POOLS tp) | Type group use (TYPE-POOLS tp) |
Interfaces
Class CL_ABAP_HMAC has no interface implemented.
Friends
Class CL_ABAP_HMAC has no friend class.
Attributes
| # | Attribute | Level | Visibility | Read only | Typing | Associated Type | Initial Value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Constant | Private | Type reference (TYPE) | C | 'X' | IsRequested | 20100329 | ||
| 2 | Constant | Private | Type reference (TYPE) | X | 88 | IsRequested | 20100329 | ||
| 3 | Constant | Private | Type reference (TYPE) | X | 16 | Calculate hash | 20100329 | ||
| 4 | Constant | Private | Type reference (TYPE) | X | 15 | Operation Code | 20100329 | ||
| 5 | Constant | Private | Type reference (TYPE) | X | 05 | Delete | 20100329 | ||
| 6 | Constant | Private | Type reference (TYPE) | X | 03 | Final status | 20100329 | ||
| 7 | Constant | Private | Type reference (TYPE) | X | 04 | Information | 20100329 | ||
| 8 | Constant | Private | Type reference (TYPE) | X | 01 | Initial status | 20100329 | ||
| 9 | Constant | Private | Type reference (TYPE) | X | 02 | Update Status | 20100329 | ||
| 10 | Constant | Private | Type reference (TYPE) | C | ' ' | C Destructor | 20100329 | ||
| 11 | Instance attribute | Private | Type reference (TYPE) | STRING | Name of the algorithm | 20100329 | |||
| 12 | Instance attribute | Private | Type reference (TYPE) | I | Length of the digest in bytes | 20100329 | |||
| 13 | Instance attribute | Private | Type reference (TYPE) | XSTRING | HMAC Key | 20100329 | |||
| 14 | Instance attribute | Private | Type reference (TYPE) | %_C_POINTER | Internal Information | 20100329 |
Methods
| # | Method | Level | Visibility | Method type | Description | Created on |
|---|---|---|---|---|---|---|
| 1 | Static method | Public | Method | Generic HMAC function (char input) | 20100329 | |
| 2 | Static method | Public | Method | Generic HMAC function (raw input) | 20100329 | |
| 3 | Instance method | Public | Constructor | CONSTRUCTOR | 20100329 | |
| 4 | Instance method | Public | Destructor | C Destructor | 20100329 | |
| 5 | Instance method | Private | Method | Evaluation of sy-subrc | 20100329 | |
| 6 | Instance method | Public | Method | Ends the HMAC; last function for streams | 20100329 | |
| 7 | Instance method | Public | Method | Returns the name of the hash algorithm | 20100329 | |
| 8 | Instance method | Public | Method | Returns the HMAC as an XString | 20100329 | |
| 9 | Instance method | Public | Method | Returns the length of the HMAC in bytes | 20100329 | |
| 10 | Static method | Public | Method | Generates an instance of the object | 20100329 | |
| 11 | Instance method | Public | Method | Initializes the MAC with a key element | 20100329 | |
| 12 | Static method | Public | Method | Compares two HMACs for equality | 20100329 | |
| 13 | Instance method | Public | Method | Resets the HMAC to initial status for new calculation | 20100329 | |
| 14 | Static method | Public | Method | Addnl function: convert string to XString for calculation | 20100329 | |
| 15 | Instance method | Public | Method | Returns the HMAC in base64 format | 20100329 | |
| 16 | Instance method | Public | Method | Returns the HMAC in string format | 20100329 | |
| 17 | Instance method | Public | Method | Updates the HMAC based on the input data | 20100329 |
Events
Class CL_ABAP_HMAC has no event.
Types
Class CL_ABAP_HMAC has no local type.
Method Signatures
Method CALCULATE_HMAC_FOR_CHAR Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | EF_HMACB64STRING | Call by reference | Type reference (TYPE) | STRING | HMAC-Wert als Base64-Encoded String | 20100329 | |||
| 2 | EF_HMACSTRING | Call by reference | Type reference (TYPE) | STRING | HMAC-Wert als Hex-Encoded String | 20100329 | |||
| 3 | EF_HMACXSTRING | Call by reference | Type reference (TYPE) | XSTRING | HMAC-Wert binär als XString | 20100329 | |||
| 4 | IF_ALGORITHM | Call by reference | Type reference (TYPE) | STRING | 'SHA1' | Hash-Algorithmus | 20100329 | ||
| 5 | IF_DATA | Call by reference | Type reference (TYPE) | STRING | Daten | 20100329 | |||
| 6 | IF_KEY | Call by reference | Type reference (TYPE) | XSTRING | HMAC Key | 20100329 | |||
| 7 | IF_LENGTH | Call by reference | Type reference (TYPE) | I | 0 | Eingabelänge (0: strlen(data)) | 20100329 |
| # | Exception | Resumable | Description | Created on |
|---|---|---|---|---|
| 1 | Ausnahmeklasse für Message Digest | 20100329 |
Method CALCULATE_HMAC_FOR_RAW Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | EF_HMACB64STRING | Call by reference | Type reference (TYPE) | STRING | HMAC-Wert als Base64-Encoded String | 20100329 | |||
| 2 | EF_HMACSTRING | Call by reference | Type reference (TYPE) | STRING | HMAC-Wert als Hex-Encoded String | 20100329 | |||
| 3 | EF_HMACXSTRING | Call by reference | Type reference (TYPE) | XSTRING | HMAC-Wert binär als XString | 20100329 | |||
| 4 | IF_ALGORITHM | Call by reference | Type reference (TYPE) | STRING | 'SHA1' | Hash-Algorithmus | 20100329 | ||
| 5 | IF_DATA | Call by reference | Type reference (TYPE) | XSTRING | Daten | 20100329 | |||
| 6 | IF_KEY | Call by reference | Type reference (TYPE) | XSTRING | HMAC Key | 20100329 | |||
| 7 | IF_LENGTH | Call by reference | Type reference (TYPE) | I | 0 | Eingabelänge (0: strlen(data)) | 20100329 |
| # | Exception | Resumable | Description | Created on |
|---|---|---|---|---|
| 1 | Ausnahmeklasse für Message Digest | 20100329 |
Method CONSTRUCTOR Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | IF_ALGORITHM | Call by reference | Type reference (TYPE) | STRING | 20100329 | ||||
| 2 | IF_KEY | Call by reference | Type reference (TYPE) | XSTRING | 20100329 |
| # | Exception | Resumable | Description | Created on |
|---|---|---|---|---|
| 1 | Ausnahmeklasse für Message Digest | 20100329 |
Method DESTRUCTOR Signature
Method DESTRUCTOR on class CL_ABAP_HMAC has no parameter.
Method DESTRUCTOR on class CL_ABAP_HMAC has no exception.
Method EVAL_SYSRC Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | IF_RC | Call by reference | Type reference (TYPE) | I | 0 | 20100329 |
| # | Exception | Resumable | Description | Created on |
|---|---|---|---|---|
| 1 | Ausnahmeklasse für Message Digest | 20100329 |
Method FINAL Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | EF_HMACB64STRING | Call by reference | Type reference (TYPE) | STRING | HMAC-Wert als Base64-Encoded String | 20100329 | |||
| 2 | EF_HMACSTRING | Call by reference | Type reference (TYPE) | STRING | HMAC-Wert als Hex-Encoded String | 20100329 | |||
| 3 | EF_HMACXSTRING | Call by reference | Type reference (TYPE) | XSTRING | HMAC-Wert binär als XString | 20100329 | |||
| 4 | IF_DATA | Call by reference | Type reference (TYPE) | XSTRING | Daten | 20100329 | |||
| 5 | IF_LENGTH | Call by reference | Type reference (TYPE) | I | 0 | Eingabelänge (0: strlen(data)) | 20100329 | ||
| 6 | IF_OFFSET | Call by reference | Type reference (TYPE) | I | 0 | Offset der Eingabe (0: Beginn) | 20100329 |
| # | Exception | Resumable | Description | Created on |
|---|---|---|---|---|
| 1 | Ausnahmeklasse für Message Digest | 20100329 |
Method GET_ALGORITHM Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | RF_ALGORITHM | Value transfer | Type reference (TYPE) | STRING | Algorithmus | 20100329 |
Method GET_ALGORITHM on class CL_ABAP_HMAC has no exception.
Method GET_HMAC Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | ER_HMAC | Value transfer | Type reference (TYPE) | XSTRING | HMAC | 20100329 |
| # | Exception | Resumable | Description | Created on |
|---|---|---|---|---|
| 1 | Ausnahmeklasse für Message Digest | 20100329 |
Method GET_HMAC_LENGTH Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | RI_LENGTH | Value transfer | Type reference (TYPE) | I | Länge | 20100329 |
| # | Exception | Resumable | Description | Created on |
|---|---|---|---|---|
| 1 | Ausnahmeklasse für Message Digest | 20100329 |
Method GET_INSTANCE Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | IF_ALGORITHM | Call by reference | Type reference (TYPE) | STRING | 'SHA1' | 20100329 | |||
| 2 | IF_KEY | Call by reference | Type reference (TYPE) | XSTRING | HMAC Key | 20100329 | |||
| 3 | RO_OBJECT | Value transfer | Object reference (TYPE REF TO) | CL_ABAP_HMAC | HMAC Objekt | 20100329 |
| # | Exception | Resumable | Description | Created on |
|---|---|---|---|---|
| 1 | Ausnahmeklasse für Message Digest | 20100329 |
Method INIT Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | IF_KEY | Call by reference | Type reference (TYPE) | XSTRING | HMAC Key | 20100329 |
| # | Exception | Resumable | Description | Created on |
|---|---|---|---|---|
| 1 | Ausnahmeklasse für Message Digest | 20100329 |
Method IS_EQUAL Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | ER_EQUAL | Value transfer | Type reference (TYPE) | ABAP_BOOL | True if Equal | 20100329 | |||
| 2 | IF_HMACA | Call by reference | Type reference (TYPE) | XSTRING | First HMAC | 20100329 | |||
| 3 | IF_HMACB | Call by reference | Type reference (TYPE) | XSTRING | Second HMAC | 20100329 |
Method IS_EQUAL on class CL_ABAP_HMAC has no exception.
Method RESET Signature
Method RESET on class CL_ABAP_HMAC has no parameter.
| # | Exception | Resumable | Description | Created on |
|---|---|---|---|---|
| 1 | Ausnahmeklasse für Message Digest | 20100329 |
Method STRING_TO_XSTRING Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | ER_OUTPUT | Value transfer | Type reference (TYPE) | XSTRING | Ausgabewert | 20100329 | |||
| 2 | IF_INPUT | Call by reference | Type reference (TYPE) | STRING | Eingabewert | 20100329 |
| # | Exception | Resumable | Description | Created on |
|---|---|---|---|---|
| 1 | Ausnahmeklasse für Message Digest | 20100329 |
Method TO_BASE64 Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | ER_HMACB64STRING | Value transfer | Type reference (TYPE) | STRING | HMAC-Wert als Base64-Encoded String | 20100329 |
| # | Exception | Resumable | Description | Created on |
|---|---|---|---|---|
| 1 | Ausnahmeklasse für Message Digest | 20100329 |
Method TO_STRING Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | ER_HMACSTRING | Value transfer | Type reference (TYPE) | STRING | HMAC-Wert als Hex-Encoded String | 20100329 |
| # | Exception | Resumable | Description | Created on |
|---|---|---|---|---|
| 1 | Ausnahmeklasse für Message Digest | 20100329 |
Method UPDATE Signature
| # | Type | Parameter | Pass Value | Optional | Typing Method | Associated Type | Default value | Description | Created on |
|---|---|---|---|---|---|---|---|---|---|
| 1 | IF_DATA | Call by reference | Type reference (TYPE) | XSTRING | Daten | 20100329 | |||
| 2 | IF_LENGTH | Call by reference | Type reference (TYPE) | I | 0 | Eingabelänge (0: strlen(data)) | 20100329 | ||
| 3 | IF_OFFSET | Call by reference | Type reference (TYPE) | I | 0 | Offset der Eingabe (0: Beginn) | 20100329 |
| # | Exception | Resumable | Description | Created on |
|---|---|---|---|---|
| 1 | Ausnahmeklasse für Message Digest | 20100329 |
History
| Last changed by/on | SAP | 20110908 |
| SAP Release Created in |