text
stringlengths
0
234
-- 8. Validate the JWS Signature against the JWS Signing Input
Text := Encoded_Header & "." & Encoded_Payload;
if not Self.Header.Validate_Signature
(ASCII.Encode (Text), Secret, Signature)
then
return;
end if;
Valid := True;
end Validate_Compact_Serialization;
------------------------
-- Validate_Signature --
------------------------
function Validate_Signature
(Self : JOSE_Header'Class;
Data : League.Stream_Element_Vectors.Stream_Element_Vector;
Secret : Ada.Streams.Stream_Element_Array;
Value : League.Stream_Element_Vectors.Stream_Element_Vector)
return Boolean
is
use type League.Strings.Universal_String;
Alg : constant League.Strings.Universal_String := Self.Algorithm;
begin
if Alg = +"HS256" then
declare
use type League.Stream_Element_Vectors.Stream_Element_Vector;
begin
return Self.Compute_Signature (Data, Secret) = Value;
Function Definition: procedure Disp_Flush
Function Body: (X1 : Int32_T;
Y1 : Int32_T;
X2 : Int32_T;
Y2 : Int32_T;
Color : access constant Color_Array)
with Convention => C;
procedure Disp_Fill
(X1 : Int32_T;
Y1 : Int32_T;
X2 : Int32_T;
Y2 : Int32_T;
Color : Lv.Color.Color_T)
with Convention => C;
procedure Disp_Map
(X1 : Int32_T;
Y1 : Int32_T;
X2 : Int32_T;
Y2 : Int32_T;
Color : access constant Color_Array)
with Convention => C;
----------------
-- Initialize --
----------------
procedure Initialize (Enable_Pointer : Boolean := True) is
Mouse_Cursor_Icon : Integer;
pragma Import (C, Mouse_Cursor_Icon, "mouse_cursor_icon");
begin
Lv.Hal.Disp.Init_Drv (LV_Disp_Drv'Access);
LV_Disp_Drv.Disp_Flush := Disp_Flush'Access;
LV_Disp_Drv.Disp_Fill := Disp_Fill'Access;
LV_Disp_Drv.Disp_Map := Disp_Map'Access;
LV_Disp := Lv.Hal.Disp.Register (LV_Disp_Drv'Access);
Lv.Hal.Disp.Set_Active (LV_Disp);
Pointer.Union.Point := (0, 0);
Pointer.State := Lv.Hal.Indev.State_Rel;
Lv.Hal.Indev.Init_Drv (LV_Indev_Keypad_Drv'Access);
LV_Indev_Keypad_Drv.Read := Read_Keypad'Access;
LV_Indev_Keypad_Drv.C_Type := Lv.Hal.Indev.Type_Keypad;
LV_Indev_Keypad := Lv.Hal.Indev.Register (LV_Indev_Keypad_Drv'Access);
Lv.Hal.Indev.Init_Drv (LV_Indev_Pointer_Drv'Access);
LV_Indev_Pointer_Drv.Read := Read_Pointer'Access;
LV_Indev_Pointer_Drv.C_Type := Lv.Hal.Indev.Type_Pointer;
LV_Indev_Pointer := Lv.Hal.Indev.Register (LV_Indev_Pointer_Drv'Access);
if Enable_Pointer then
Cursor_Obj := Lv.Objx.Img.Create (Lv.Objx.Scr_Act, Lv.Objx.No_Obj);
Lv.Objx.Img.Set_Src (Cursor_Obj, Mouse_Cursor_Icon'Address);
Lv.Indev.Set_Cursor (LV_Indev_Pointer, Cursor_Obj);
end if;
end Initialize;
------------------
-- Keypad_Indev --
------------------