MAC¶
The MAC
function uses a user-specified MAC
function to return the hashed
MAC
value of a RAW
or CLOB
value. The MAC
function is available in three forms:
MAC
(<src> IN RAW, <typ> IN INTEGER, <key> IN RAW) RETURN RAW
MAC
(<src> IN CLOB, <typ> IN INTEGER, <key> IN RAW) RETURN RAW
Parameters
src
src
specifies the value for which theMAC
value will be generated. Specify aRAW
,BLOB
, orCLOB
value.
typ
typ
specifies theMAC
function used. Advanced Server supports theMAC
functions listed below.
MAC Functions |
|
---|---|
|
|
|
|
key
key
specifies the key that will be used to calculate the hashedMAC
value.
Examples
The following example finds the hashed MAC
value of the string cleartext
source
:
DECLARE
typ INTEGER := DBMS_CRYPTO.HMAC_MD5;
key RAW(100) := 'my secret key';
mac_value RAW(100);
BEGIN
mac_value := DBMS_CRYPTO.MAC('cleartext source', typ, key);
END;
DBMS_CRYPTO.MAC
uses a key value of my secret
key when calculating the
MAC
value of cleartext source
.