src/Secrets.php
static public function decrypt($ciphertextFileName, Config $config = null) {
        // Instantiate the client, authenticate, and add scopes.
        $kms = self::getService();
        $name = self::getDefaultKeyName($config);
        // Use the KMS API to decrypt the text.
        $ciphertext = base64_encode(file_get_contents($ciphertextFileName));
        $request = new \Google_Service_CloudKMS_DecryptRequest();
        $request->setCiphertext($ciphertext);
        $response = $kms->projects_locations_keyRings_cryptoKeys->decrypt(
            $name,
            $request
        );
        return base64_decode($response['plaintext']);
    }
static public function decrypt($ciphertextFileName, Config $config = null) {
        // Instantiate the client, authenticate, and add scopes.
        $kms = self::getService();
        $name = self::getDefaultKeyName($config);
        // Use the KMS API to decrypt the text.
        $ciphertext = base64_encode(file_get_contents($ciphertextFileName));
        $request = new \Google_Service_CloudKMS_DecryptRequest();
        $request->setCiphertext($ciphertext);
        $response = $kms->projects_locations_keyRings_cryptoKeys->decrypt(
            $name,
            $request
        );
        return base64_decode($response['plaintext']);
    }
static public function decrypt ( $ ciphertextFileName , Config $ config = null ) { // Instantiate the client, authenticate, and add scopes. $ kms = self :: getService ( ) ; $ name = self :: getDefaultKeyName ( $ config ) ; // Use the KMS API to decrypt the text. $ ciphertext = base64_encode ( file_get_contents ( $ ciphertextFileName ) ) ; $ request = new \ Google_Service_CloudKMS_DecryptRequest ( ) ; $ request -> setCiphertext ( $ ciphertext ) ; $ response = $ kms -> projects_locations_keyRings_cryptoKeys -> decrypt ( $ name , $ request ) ; return base64_decode ( $ response [ 'plaintext' ] ) ; }
Can receive the config singleton to be able to be used of the config class
during initiation of that object.

@param $ciphertextFileName
@param Conf|null $conf
@return bool|string
Can receive the config singleton to be able to be used of the config class during initiation of that object .