jose-php icon indicating copy to clipboard operation
jose-php copied to clipboard

JWS(Signing issue)

Open siva-fstack opened this issue 5 years ago • 0 comments

Hi,

I have tried siging, encryption and decryption using this library. Encryption and decryption working fine, for my case i need to sign first and then needs to be encrypt here i am facing problem in signing, i am not getting any signing result in raw=> . could you help with below code?

//client private key
$client_privateKey = file_get_contents('config/keys/client_private.key');

    $server_publicKey = file_get_contents('config/keys/server_public.key');
    
    $server_privateKey = file_get_contents('config/keys/server_private.key');
    
    $client_publicKey = file_get_contents('config/keys/client_public.key');
    
    $payload = array(
        "IssueTime " => "2020-04-06T09:45:43.567",
        "Issuer " => ORG_ID,
        "Payload" => $post_data
    );
    
    $json_encoded = json_encode($payload);        
    
    
    // JWS/signing
    $jwt = new JOSE_JWT($json_encoded);
    $jws = $jwt->sign($client_privateKey, 'RS256');
    
    echo "Signature client payload<br /><pre>\n";
    print_r($jws);
    echo "</pre>\n";

image

siva-fstack avatar Apr 07 '20 03:04 siva-fstack