You're close :-) Those carriage returns matter
SQL> set serverout on
SQL> DECLARE
2 ip_str VARCHAR2 (200) := 'Secret Message';
3 pubkey VARCHAR (2000) := 'MIIBIjANBgkqhkiG9w0BAQEFAAOCA....(the rest on ONE LINE)';
4 prvkey VARCHAR (2000) := 'MIIEuwIBADANBgkqhkiG9w0BAQEF....(the rest on ONE LINE)';
5
6 sign_raw RAW (2000);
7 returnval BOOLEAN := false;
8 sType PLS_INTEGER := DBMS_CRYPTO.SIGN_SHA224_RSA;
9 kType PLS_INTEGER := DBMS_CRYPTO.KEY_TYPE_RSA;
10 BEGIN
11 sign_raw := DBMS_CRYPTO.SIGN
12 (
13 src => UTL_I18N.STRING_TO_RAW(ip_str,'AL32UTF8'),
14 prv_key => UTL_I18N.STRING_TO_RAW( prvkey, 'AL32UTF8'),
15 pubkey_alg => kType,
16 sign_alg => sType
17 );
18 returnval := DBMS_CRYPTO.VERIFY
19 (
20 src => UTL_I18N.STRING_TO_RAW( ip_str,'AL32UTF8'),
21 sign => sign_raw,
22 pub_key => UTL_I18N.STRING_TO_RAW( pubkey, 'AL32UTF8'),
23 pubkey_alg => kType,
24 sign_alg => sType
25 );
26 DBMS_OUTPUT.PUT_LINE('-------------------------------------------------');
27 IF returnval THEN
28 DBMS_OUTPUT.PUT_LINE('True');
29 ELSE
30 DBMS_OUTPUT.PUT_LINE('False');
31 END IF;
32 DBMS_OUTPUT.PUT_LINE('-------------------------------------------------');
33 END;
34 /
-------------------------------------------------
True
-------------------------------------------------
PL/SQL procedure successfully completed.