Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Service Configurations for Client Encryption PHP

Jean-Alexis Aufauvre edited this page Jul 1, 2020 · 6 revisions

Table of Contents

Overview

Predefined service configurations for the PHP client encryption library.

Configurations

$config = FieldLevelEncryptionConfigBuilder::aFieldLevelEncryptionConfig()
    ->withEncryptionPath('$.pushFundingAccount.encryptedPayload.encryptedData', '$.pushFundingAccount.encryptedPayload')
    ->withEncryptionCertificate($encryptionCertificate)
    ->withOaepPaddingDigestAlgorithm('SHA-512')
    ->withEncryptedValueFieldName('encryptedData')
    ->withEncryptedKeyFieldName('encryptedKey')
    ->withIvFieldName('iv')
    ->withOaepPaddingDigestAlgorithmFieldName('oaepHashingAlgorithm')
    ->withEncryptionCertificateFingerprintFieldName('publicKeyFingerprint')
    ->withFieldValueEncoding(FieldValueEncoding::HEX)
    ->build();
$config = FieldLevelEncryptionConfigBuilder::aFieldLevelEncryptionConfig()
    ->withEncryptionPath('$.cardInfo.encryptedData', '$.cardInfo') // Before version 1.2.9
    ->withEncryptionPath('$.fundingAccountInfo.encryptedPayload.encryptedData', '$.fundingAccountInfo.encryptedPayload')
    ->withEncryptionPath('$.encryptedPayload.encryptedData', '$.encryptedPayload')
    ->withDecryptionPath('$.tokenDetail', '$.tokenDetail.encryptedData')
    ->withDecryptionPath('$.encryptedPayload', '$.encryptedPayload.encryptedData')
    ->withEncryptionCertificate($encryptionCertificate)
    ->withDecryptionKey($decryptionKey)
    ->withOaepPaddingDigestAlgorithm('SHA-512')
    ->withEncryptedValueFieldName('encryptedData')
    ->withEncryptedKeyFieldName('encryptedKey')
    ->withIvFieldName('iv')
    ->withOaepPaddingDigestAlgorithmFieldName('oaepHashingAlgorithm')
    ->withEncryptionCertificateFingerprintFieldName('publicKeyFingerprint')
    ->withFieldValueEncoding(FieldValueEncoding::HEX)
    ->build();

Installment APIs for Financial and Non-Financial Institutions

$config = FieldLevelEncryptionConfigBuilder::aFieldLevelEncryptionConfig()
    ->withEncryptionPath('$.calculatorReqData.primaryAccountNumber', '$.calculatorReqData')
    ->withEncryptionPath('$.configReqData.primaryAccountNumber', '$.configReqData')
    ->withEncryptionPath('$.processInstallmentReqData.primaryAccountNumber', '$.processInstallmentReqData')
    ->withEncryptionPath('$.receiveIssuerApprReqData.primaryAccountNumber', '$.receiveIssuerApprReqData')
    ->withEncryptionCertificate($encryptionCertificate)
    ->withOaepPaddingDigestAlgorithm('SHA-256')
    ->withEncryptedValueFieldName('primaryAccountNumber')
    ->withEncryptedKeyFieldName('wrappedKey')
    ->withIvFieldName('iv')
    ->withFieldValueEncoding(FieldValueEncoding::BASE64)
    ->build();
$config = FieldLevelEncryptionConfigBuilder::aFieldLevelEncryptionConfig()
    ->withEncryptionPath('$.encryptedPayload.encryptedData', '$.encryptedPayload')
    ->withDecryptionPath('$.encryptedPayload', '$.encryptedPayload.encryptedData')
    ->withEncryptionCertificate($encryptionCertificate)
    ->withDecryptionKey($decryptionKey)
    ->withOaepPaddingDigestAlgorithm('SHA-512')
    ->withEncryptedValueFieldName('encryptedData')
    ->withEncryptedKeyFieldName('encryptedKey')
    ->withIvFieldName('iv')
    ->withOaepPaddingDigestAlgorithmFieldName('oaepHashingAlgorithm')
    ->withEncryptionCertificateFingerprintFieldName('publicKeyFingerprint')
    ->withFieldValueEncoding(FieldValueEncoding::HEX)
    ->build();
$config = FieldLevelEncryptionConfigBuilder::aFieldLevelEncryptionConfig()
    ->withEncryptionPath('$.encryptedPayload.encryptedData', '$.encryptedPayload')
    ->withDecryptionPath('$.encryptedPayload', '$.encryptedPayload.encryptedData')
    ->withEncryptionCertificate($encryptionCertificate)
    ->withDecryptionKey($decryptionKey)
    ->withOaepPaddingDigestAlgorithm('SHA-512')
    ->withEncryptedValueFieldName('encryptedData')
    ->withEncryptedKeyFieldName('encryptedKey')
    ->withIvFieldName('iv')
    ->withOaepPaddingDigestAlgorithmFieldName('oaepHashingAlgorithm')
    ->withEncryptionCertificateFingerprintFieldName('publicKeyFingerprint')
    ->withFieldValueEncoding(FieldValueEncoding::HEX)
    ->build();
$config = FieldLevelEncryptionConfigBuilder::aFieldLevelEncryptionConfig()
    ->withDecryptionPath('$', '$.items')
    ->withDecryptionKey($decryptionKey)
    ->withOaepPaddingDigestAlgorithm('SHA-512')
    ->withEncryptedValueFieldName('items')
    ->withEncryptedKeyFieldName('encryptedKey')
    ->withIvFieldName('iv')
    ->withOaepPaddingDigestAlgorithmFieldName('oaepHashingAlgorithm')
    ->withFieldValueEncoding(FieldValueEncoding::BASE64)
    ->build();
$config = FieldLevelEncryptionConfigBuilder::aFieldLevelEncryptionConfig()
    ->withDecryptionPath('$', '$.items')
    ->withDecryptionKey($decryptionKey)
    ->withOaepPaddingDigestAlgorithm('SHA-512')
    ->withEncryptedValueFieldName('items')
    ->withEncryptedKeyFieldName('encryptedKey')
    ->withIvFieldName('iv')
    ->withOaepPaddingDigestAlgorithmFieldName('oaepHashingAlgorithm')
    ->withFieldValueEncoding(FieldValueEncoding::BASE64)
    ->build();
$config = FieldLevelEncryptionConfigBuilder::aFieldLevelEncryptionConfig()
    ->withEncryptionPath('$', '$.encrypted_payload')
    ->withDecryptionPath('$.encrypted_payload', '$')
    ->withEncryptionCertificate($encryptionCertificate)
    ->withDecryptionKey($decryptionKey)
    ->withOaepPaddingDigestAlgorithm('SHA-256')
    ->withEncryptedValueFieldName('data')
    ->withEncryptedKeyHeaderName('x-encrypted-key')
    ->withIvHeaderName('x-iv')
    ->withOaepPaddingDigestAlgorithmHeaderName('x-oaep-hashing-algorithm')
    ->withEncryptionKeyFingerprintHeaderName('x-public-key-fingerprint')
    ->withFieldValueEncoding(FieldValueEncoding::BASE64)
    ->build();
$config = FieldLevelEncryptionConfigBuilder::aFieldLevelEncryptionConfig()
    ->withEncryptionCertificate($encryptionCertificate) 
    ->withDecryptionKey($decryptionKey) 
    ->withEncryptionPath('$.card', '$.encryptedCard') 
    ->withDecryptionPath('$.encryptedCard', '$.card') 
    ->withOaepPaddingDigestAlgorithm('SHA-256') 
    ->withEncryptedValueFieldName('encryptedValue') 
    ->withEncryptedKeyFieldName('encryptedKey')
    ->withIvFieldName('iv') 
    ->withOaepPaddingDigestAlgorithmFieldName('oaepPaddingDigestAlgorithm')
    ->withEncryptionKeyFingerprintFieldName('publicKeyFingerprint')
    ->withFieldValueEncoding(FieldValueEncoding::BASE64) 
    ->build();
$config = FieldLevelEncryptionConfigBuilder::aFieldLevelEncryptionConfig()
    ->withDecryptionKey($decryptionKey)
    ->withDecryptionPath('$.encryptedCard', '$.card')
    ->withOaepPaddingDigestAlgorithm('SHA-256')
    ->withEncryptedValueFieldName('encryptedValue')
    ->withEncryptedKeyFieldName('encryptedKey')
    ->withIvFieldName('iv')
    ->withOaepPaddingDigestAlgorithmFieldName('oaepPaddingDigestAlgorithm')
    ->withEncryptionKeyFingerprintFieldName('publicKeyFingerprint')
    ->withFieldValueEncoding(FieldValueEncoding::BASE64)
    ->build();
Clone this wiki locally