Class: Aws::PaymentCryptographyData::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-paymentcryptographydata/lib/aws-sdk-paymentcryptographydata/client.rb

Overview

An API client for PaymentCryptographyData. To construct a client, you need to configure a :region and :credentials.

client = Aws::PaymentCryptographyData::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

For details on configuring region and credentials see the developer guide.

See #initialize for a full list of supported configuration options.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#api_requests, #stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

Parameters:

  • options (Hash)

Options Hash (options):

  • :credentials (required, Aws::CredentialProvider)

    Your AWS credentials. This can be an instance of any one of the following classes:

    • Aws::Credentials - Used for configuring static, non-refreshing credentials.

    • Aws::SharedCredentials - Used for loading static credentials from a shared file, such as ~/.aws/config.

    • Aws::AssumeRoleCredentials - Used when you need to assume a role.

    • Aws::AssumeRoleWebIdentityCredentials - Used when you need to assume a role after providing credentials via the web.

    • Aws::SSOCredentials - Used for loading credentials from AWS SSO using an access token generated from aws login.

    • Aws::ProcessCredentials - Used for loading credentials from a process that outputs to stdout.

    • Aws::InstanceProfileCredentials - Used for loading credentials from an EC2 IMDS on an EC2 instance.

    • Aws::ECSCredentials - Used for loading credentials from instances running in ECS.

    • Aws::CognitoIdentityCredentials - Used for loading credentials from the Cognito Identity service.

    When :credentials are not configured directly, the following locations will be searched for credentials:

    • Aws.config[:credentials]
    • The :access_key_id, :secret_access_key, and :session_token options.
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • ~/.aws/credentials
    • ~/.aws/config
    • EC2/ECS IMDS instance profile - When used by default, the timeouts are very aggressive. Construct and pass an instance of Aws::InstanceProfileCredentails or Aws::ECSCredentials to enable retries and extended timeouts. Instance profile credential fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED'] to true.
  • :region (required, String)

    The AWS region to connect to. The configured :region is used to determine the service :endpoint. When not passed, a default :region is searched for in the following locations:

    • Aws.config[:region]
    • ENV['AWS_REGION']
    • ENV['AMAZON_REGION']
    • ENV['AWS_DEFAULT_REGION']
    • ~/.aws/credentials
    • ~/.aws/config
  • :access_key_id (String)
  • :active_endpoint_cache (Boolean) — default: false

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false.

  • :adaptive_retry_wait_to_fill (Boolean) — default: true

    Used only in adaptive retry mode. When true, the request will sleep until there is sufficent client side capacity to retry the request. When false, the request will raise a RetryCapacityNotAvailableError and will not retry instead of sleeping.

  • :client_side_monitoring (Boolean) — default: false

    When true, client-side metrics will be collected for all API requests from this client.

  • :client_side_monitoring_client_id (String) — default: ""

    Allows you to provide an identifier for this client which will be attached to all generated client side metrics. Defaults to an empty string.

  • :client_side_monitoring_host (String) — default: "127.0.0.1"

    Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_port (Integer) — default: 31000

    Required for publishing client metrics. The port that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher) — default: Aws::ClientSideMonitoring::Publisher

    Allows you to provide a custom client-side monitoring publisher class. By default, will use the Client Side Monitoring Agent Publisher.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types.

  • :correct_clock_skew (Boolean) — default: true

    Used only in standard and adaptive retry modes. Specifies whether to apply a clock skew correction and retry requests with skewed client clocks.

  • :defaults_mode (String) — default: "legacy"

    See DefaultsModeConfiguration for a list of the accepted modes and the configuration defaults that are included.

  • :disable_host_prefix_injection (Boolean) — default: false

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available.

  • :disable_request_compression (Boolean) — default: false

    When set to 'true' the request body will not be compressed for supported operations.

  • :endpoint (String, URI::HTTPS, URI::HTTP)

    Normally you should not configure the :endpoint option directly. This is normally constructed from the :region option. Configuring :endpoint is normally reserved for connecting to test or custom endpoints. The endpoint should be a URI formatted like:

    'http://example.com'
    'https://example.com'
    'http://example.com:123'
    
  • :endpoint_cache_max_entries (Integer) — default: 1000

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000.

  • :endpoint_cache_max_threads (Integer) — default: 10

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.

  • :endpoint_cache_poll_interval (Integer) — default: 60

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec.

  • :endpoint_discovery (Boolean) — default: false

    When set to true, endpoint discovery will be enabled for operations when available.

  • :ignore_configured_endpoint_urls (Boolean)

    Setting to true disables use of endpoint URLs provided via environment variables and the shared configuration file.

  • :log_formatter (Aws::Log::Formatter) — default: Aws::Log::Formatter.default

    The log formatter.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the :logger at.

  • :logger (Logger)

    The Logger instance to send log messages to. If this option is not set, logging will be disabled.

  • :max_attempts (Integer) — default: 3

    An integer representing the maximum number attempts that will be made for a single request, including the initial attempt. For example, setting this value to 5 will result in a request being retried up to 4 times. Used in standard and adaptive retry modes.

  • :profile (String) — default: "default"

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used.

  • :request_min_compression_size_bytes (Integer) — default: 10240

    The minimum size in bytes that triggers compression for request bodies. The value must be non-negative integer value between 0 and 10485780 bytes inclusive.

  • :retry_backoff (Proc)

    A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. This option is only used in the legacy retry mode.

  • :retry_base_delay (Float) — default: 0.3

    The base delay in seconds used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_jitter (Symbol) — default: :none

    A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number. This option is only used in the legacy retry mode.

    @see https://www.awsarchitectureblog.com/2015/03/backoff.html

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors, auth errors, endpoint discovery, and errors from expired credentials. This option is only used in the legacy retry mode.

  • :retry_max_delay (Integer) — default: 0

    The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_mode (String) — default: "legacy"

    Specifies which retry algorithm to use. Values are:

    • legacy - The pre-existing retry behavior. This is default value if no retry mode is provided.

    • standard - A standardized set of retry rules across the AWS SDKs. This includes support for retry quotas, which limit the number of unsuccessful retries a client can make.

    • adaptive - An experimental retry mode that includes all the functionality of standard mode along with automatic client side throttling. This is a provisional mode that may change behavior in the future.

  • :sdk_ua_app_id (String)

    A unique and opaque application ID that is appended to the User-Agent header as app/. It should have a maximum length of 50.

  • :secret_access_key (String)
  • :session_token (String)
  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled.

  • :token_provider (Aws::TokenProvider)

    A Bearer Token Provider. This can be an instance of any one of the following classes:

    • Aws::StaticTokenProvider - Used for configuring static, non-refreshing tokens.

    • Aws::SSOTokenProvider - Used for loading tokens from AWS SSO using an access token generated from aws login.

    When :token_provider is not configured directly, the Aws::TokenProviderChain will be used to search for tokens configured for your profile in shared configuration files.

  • :use_dualstack_endpoint (Boolean)

    When set to true, dualstack enabled endpoints (with .aws TLD) will be used if available.

  • :use_fips_endpoint (Boolean)

    When set to true, fips compatible endpoints will be used if available. When a fips region is used, the region is normalized and this config is set to true.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request.

  • :endpoint_provider (Aws::PaymentCryptographyData::EndpointProvider)

    The endpoint provider used to resolve endpoints. Any object that responds to #resolve_endpoint(parameters) where parameters is a Struct similar to Aws::PaymentCryptographyData::EndpointParameters

  • :http_continue_timeout (Float) — default: 1

    The number of seconds to wait for a 100-continue response before sending the request body. This option has no effect unless the request has "Expect" header set to "100-continue". Defaults to nil which disables this behaviour. This value can safely be set per request on the session.

  • :http_idle_timeout (Float) — default: 5

    The number of seconds a connection is allowed to sit idle before it is considered stale. Stale connections are closed and removed from the pool before making a request.

  • :http_open_timeout (Float) — default: 15

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_proxy (URI::HTTP, String)

    A proxy to send requests through. Formatted like 'http://proxy.com:123'.

  • :http_read_timeout (Float) — default: 60

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_wire_trace (Boolean) — default: false

    When true, HTTP debug output will be sent to the :logger.

  • :on_chunk_received (Proc)

    When a Proc object is provided, it will be used as callback when each chunk of the response body is received. It provides three arguments: the chunk, the number of bytes received, and the total number of bytes in the response (or nil if the server did not send a content-length).

  • :on_chunk_sent (Proc)

    When a Proc object is provided, it will be used as callback when each chunk of the request body is sent. It provides three arguments: the chunk, the number of bytes read from the body, and the total number of bytes in the body.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised.

  • :ssl_ca_bundle (String)

    Full path to the SSL certificate authority bundle file that should be used when verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_directory (String)

    Full path of the directory that contains the unbundled SSL certificate authority files for verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_store (String)

    Sets the X509::Store to verify peer certificate.

  • :ssl_timeout (Float)

    Sets the SSL timeout in seconds

  • :ssl_verify_peer (Boolean) — default: true

    When true, SSL peer certificates are verified when establishing a connection.



409
410
411
# File 'gems/aws-sdk-paymentcryptographydata/lib/aws-sdk-paymentcryptographydata/client.rb', line 409

def initialize(*args)
  super
end

Instance Method Details

#decrypt_data(params = {}) ⇒ Types::DecryptDataOutput

Decrypts ciphertext data to plaintext using a symmetric (TDES, AES), asymmetric (RSA), or derived (DUKPT or EMV) encryption key scheme. For more information, see Decrypt data in the Amazon Web Services Payment Cryptography User Guide.

You can use an encryption key generated within Amazon Web Services Payment Cryptography, or you can import your own encryption key by calling ImportKey. For this operation, the key must have KeyModesOfUse set to Decrypt. In asymmetric decryption, Amazon Web Services Payment Cryptography decrypts the ciphertext using the private component of the asymmetric encryption key pair. For data encryption outside of Amazon Web Services Payment Cryptography, you can export the public component of the asymmetric key pair by calling GetPublicCertificate.

For symmetric and DUKPT decryption, Amazon Web Services Payment Cryptography supports TDES and AES algorithms. For EMV decryption, Amazon Web Services Payment Cryptography supports TDES algorithms. For asymmetric decryption, Amazon Web Services Payment Cryptography supports RSA.

When you use TDES or TDES DUKPT, the ciphertext data length must be a multiple of 8 bytes. For AES or AES DUKPT, the ciphertext data length must be a multiple of 16 bytes. For RSA, it sould be equal to the key size unless padding is enabled.

For information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the Amazon Web Services Payment Cryptography User Guide.

Cross-account use: This operation can't be used across different Amazon Web Services accounts.

Related operations:

Examples:

Request syntax with placeholder values


resp = client.decrypt_data({
  cipher_text: "HexEvenLengthBetween16And4096", # required
  decryption_attributes: { # required
    asymmetric: {
      padding_type: "PKCS1", # accepts PKCS1, OAEP_SHA1, OAEP_SHA256, OAEP_SHA512
    },
    dukpt: {
      dukpt_key_derivation_type: "TDES_2KEY", # accepts TDES_2KEY, TDES_3KEY, AES_128, AES_192, AES_256
      dukpt_key_variant: "BIDIRECTIONAL", # accepts BIDIRECTIONAL, REQUEST, RESPONSE
      initialization_vector: "HexLength16Or32",
      key_serial_number: "HexLengthBetween10And24", # required
      mode: "ECB", # accepts ECB, CBC
    },
    emv: {
      initialization_vector: "HexLength16Or32",
      major_key_derivation_mode: "EMV_OPTION_A", # required, accepts EMV_OPTION_A, EMV_OPTION_B
      mode: "ECB", # accepts ECB, CBC
      pan_sequence_number: "HexLengthEquals2", # required
      primary_account_number: "NumberLengthBetween12And19", # required
      session_derivation_data: "HexLengthEquals16", # required
    },
    symmetric: {
      initialization_vector: "HexLength16Or32",
      mode: "ECB", # required, accepts ECB, CBC, CFB, CFB1, CFB8, CFB64, CFB128, OFB
      padding_type: "PKCS1", # accepts PKCS1, OAEP_SHA1, OAEP_SHA256, OAEP_SHA512
    },
  },
  key_identifier: "KeyArnOrKeyAliasType", # required
})

Response structure


resp.key_arn #=> String
resp.key_check_value #=> String
resp.plain_text #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :cipher_text (required, String)

    The ciphertext to decrypt.

  • :decryption_attributes (required, Types::EncryptionDecryptionAttributes)

    The encryption key type and attributes for ciphertext decryption.

  • :key_identifier (required, String)

    The keyARN of the encryption key that Amazon Web Services Payment Cryptography uses for ciphertext decryption.

Returns:

See Also:



523
524
525
526
# File 'gems/aws-sdk-paymentcryptographydata/lib/aws-sdk-paymentcryptographydata/client.rb', line 523

def decrypt_data(params = {}, options = {})
  req = build_request(:decrypt_data, params)
  req.send_request(options)
end

#encrypt_data(params = {}) ⇒ Types::EncryptDataOutput

Encrypts plaintext data to ciphertext using a symmetric (TDES, AES), asymmetric (RSA), or derived (DUKPT or EMV) encryption key scheme. For more information, see Encrypt data in the Amazon Web Services Payment Cryptography User Guide.

You can generate an encryption key within Amazon Web Services Payment Cryptography by calling CreateKey. You can import your own encryption key by calling ImportKey. For this operation, the key must have KeyModesOfUse set to Encrypt. In asymmetric encryption, plaintext is encrypted using public component. You can import the public component of an asymmetric key pair created outside Amazon Web Services Payment Cryptography by calling ImportKey.

For symmetric and DUKPT encryption, Amazon Web Services Payment Cryptography supports TDES and AES algorithms. For EMV encryption, Amazon Web Services Payment Cryptography supports TDES algorithms.For asymmetric encryption, Amazon Web Services Payment Cryptography supports RSA.

When you use TDES or TDES DUKPT, the plaintext data length must be a multiple of 8 bytes. For AES or AES DUKPT, the plaintext data length must be a multiple of 16 bytes. For RSA, it sould be equal to the key size unless padding is enabled.

To encrypt using DUKPT, you must already have a BDK (Base Derivation Key) key in your account with KeyModesOfUse set to DeriveKey, or you can generate a new DUKPT key by calling CreateKey. To encrypt using EMV, you must already have an IMK (Issuer Master Key) key in your account with KeyModesOfUse set to DeriveKey.

For information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the Amazon Web Services Payment Cryptography User Guide.

Cross-account use: This operation can't be used across different Amazon Web Services accounts.

Related operations:

Examples:

Request syntax with placeholder values


resp = client.encrypt_data({
  encryption_attributes: { # required
    asymmetric: {
      padding_type: "PKCS1", # accepts PKCS1, OAEP_SHA1, OAEP_SHA256, OAEP_SHA512
    },
    dukpt: {
      dukpt_key_derivation_type: "TDES_2KEY", # accepts TDES_2KEY, TDES_3KEY, AES_128, AES_192, AES_256
      dukpt_key_variant: "BIDIRECTIONAL", # accepts BIDIRECTIONAL, REQUEST, RESPONSE
      initialization_vector: "HexLength16Or32",
      key_serial_number: "HexLengthBetween10And24", # required
      mode: "ECB", # accepts ECB, CBC
    },
    emv: {
      initialization_vector: "HexLength16Or32",
      major_key_derivation_mode: "EMV_OPTION_A", # required, accepts EMV_OPTION_A, EMV_OPTION_B
      mode: "ECB", # accepts ECB, CBC
      pan_sequence_number: "HexLengthEquals2", # required
      primary_account_number: "NumberLengthBetween12And19", # required
      session_derivation_data: "HexLengthEquals16", # required
    },
    symmetric: {
      initialization_vector: "HexLength16Or32",
      mode: "ECB", # required, accepts ECB, CBC, CFB, CFB1, CFB8, CFB64, CFB128, OFB
      padding_type: "PKCS1", # accepts PKCS1, OAEP_SHA1, OAEP_SHA256, OAEP_SHA512
    },
  },
  key_identifier: "KeyArnOrKeyAliasType", # required
  plain_text: "HexEvenLengthBetween16And4064", # required
})

Response structure


resp.cipher_text #=> String
resp.key_arn #=> String
resp.key_check_value #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :encryption_attributes (required, Types::EncryptionDecryptionAttributes)

    The encryption key type and attributes for plaintext encryption.

  • :key_identifier (required, String)

    The keyARN of the encryption key that Amazon Web Services Payment Cryptography uses for plaintext encryption.

  • :plain_text (required, String)

    The plaintext to be encrypted.

    For encryption using asymmetric keys, plaintext data length is constrained by encryption key strength that you define in KeyAlgorithm and padding type that you define in AsymmetricEncryptionAttributes. For more information, see Encrypt data in the Amazon Web Services Payment Cryptography User Guide.

Returns:

See Also:



655
656
657
658
# File 'gems/aws-sdk-paymentcryptographydata/lib/aws-sdk-paymentcryptographydata/client.rb', line 655

def encrypt_data(params = {}, options = {})
  req = build_request(:encrypt_data, params)
  req.send_request(options)
end

#generate_card_validation_data(params = {}) ⇒ Types::GenerateCardValidationDataOutput

Generates card-related validation data using algorithms such as Card Verification Values (CVV/CVV2), Dynamic Card Verification Values (dCVV/dCVV2), or Card Security Codes (CSC). For more information, see Generate card data in the Amazon Web Services Payment Cryptography User Guide.

This operation generates a CVV or CSC value that is printed on a payment credit or debit card during card production. The CVV or CSC, PAN (Primary Account Number) and expiration date of the card are required to check its validity during transaction processing. To begin this operation, a CVK (Card Verification Key) encryption key is required. You can use CreateKey or ImportKey to establish a CVK within Amazon Web Services Payment Cryptography. The KeyModesOfUse should be set to Generate and Verify for a CVK encryption key.

For information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the Amazon Web Services Payment Cryptography User Guide.

Cross-account use: This operation can't be used across different Amazon Web Services accounts.

Related operations:

Examples:

Request syntax with placeholder values


resp = client.generate_card_validation_data({
  generation_attributes: { # required
    amex_card_security_code_version_1: {
      card_expiry_date: "NumberLengthEquals4", # required
    },
    amex_card_security_code_version_2: {
      card_expiry_date: "NumberLengthEquals4", # required
      service_code: "NumberLengthEquals3", # required
    },
    card_holder_verification_value: {
      application_transaction_counter: "HexLengthBetween2And4", # required
      pan_sequence_number: "HexLengthEquals2", # required
      unpredictable_number: "HexLengthBetween2And8", # required
    },
    card_verification_value_1: {
      card_expiry_date: "NumberLengthEquals4", # required
      service_code: "NumberLengthEquals3", # required
    },
    card_verification_value_2: {
      card_expiry_date: "NumberLengthEquals4", # required
    },
    dynamic_card_verification_code: {
      application_transaction_counter: "HexLengthBetween2And4", # required
      pan_sequence_number: "HexLengthEquals2", # required
      track_data: "HexLengthBetween2And160", # required
      unpredictable_number: "HexLengthBetween2And8", # required
    },
    dynamic_card_verification_value: {
      application_transaction_counter: "HexLengthBetween2And4", # required
      card_expiry_date: "NumberLengthEquals4", # required
      pan_sequence_number: "HexLengthEquals2", # required
      service_code: "NumberLengthEquals3", # required
    },
  },
  key_identifier: "KeyArnOrKeyAliasType", # required
  primary_account_number: "NumberLengthBetween12And19", # required
  validation_data_length: 1,
})

Response structure


resp.key_arn #=> String
resp.key_check_value #=> String
resp.validation_data #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :generation_attributes (required, Types::CardGenerationAttributes)

    The algorithm for generating CVV or CSC values for the card within Amazon Web Services Payment Cryptography.

  • :key_identifier (required, String)

    The keyARN of the CVK encryption key that Amazon Web Services Payment Cryptography uses to generate card data.

  • :primary_account_number (required, String)

    The Primary Account Number (PAN), a unique identifier for a payment credit or debit card that associates the card with a specific account holder.

  • :validation_data_length (Integer)

    The length of the CVV or CSC to be generated. The default value is 3.

Returns:

See Also:



771
772
773
774
# File 'gems/aws-sdk-paymentcryptographydata/lib/aws-sdk-paymentcryptographydata/client.rb', line 771

def generate_card_validation_data(params = {}, options = {})
  req = build_request(:generate_card_validation_data, params)
  req.send_request(options)
end

#generate_mac(params = {}) ⇒ Types::GenerateMacOutput

Generates a Message Authentication Code (MAC) cryptogram within Amazon Web Services Payment Cryptography.

You can use this operation to authenticate card-related data by using known data values to generate MAC for data validation between the sending and receiving parties. This operation uses message data, a secret encryption key and MAC algorithm to generate a unique MAC value for transmission. The receiving party of the MAC must use the same message data, secret encryption key and MAC algorithm to reproduce another MAC value for comparision.

You can use this operation to generate a DUPKT, CMAC, HMAC or EMV MAC by setting generation attributes and algorithm to the associated values. The MAC generation encryption key must have valid values for KeyUsage such as TR31_M7_HMAC_KEY for HMAC generation, and they key must have KeyModesOfUse set to Generate and Verify.

For information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the Amazon Web Services Payment Cryptography User Guide.

Cross-account use: This operation can't be used across different Amazon Web Services accounts.

Related operations:

  • VerifyMac

^

Examples:

Request syntax with placeholder values


resp = client.generate_mac({
  generation_attributes: { # required
    algorithm: "ISO9797_ALGORITHM1", # accepts ISO9797_ALGORITHM1, ISO9797_ALGORITHM3, CMAC, HMAC_SHA224, HMAC_SHA256, HMAC_SHA384, HMAC_SHA512
    dukpt_cmac: {
      dukpt_derivation_type: "TDES_2KEY", # accepts TDES_2KEY, TDES_3KEY, AES_128, AES_192, AES_256
      dukpt_key_variant: "BIDIRECTIONAL", # required, accepts BIDIRECTIONAL, REQUEST, RESPONSE
      key_serial_number: "HexLengthBetween10And24", # required
    },
    dukpt_iso_9797_algorithm_1: {
      dukpt_derivation_type: "TDES_2KEY", # accepts TDES_2KEY, TDES_3KEY, AES_128, AES_192, AES_256
      dukpt_key_variant: "BIDIRECTIONAL", # required, accepts BIDIRECTIONAL, REQUEST, RESPONSE
      key_serial_number: "HexLengthBetween10And24", # required
    },
    dukpt_iso_9797_algorithm_3: {
      dukpt_derivation_type: "TDES_2KEY", # accepts TDES_2KEY, TDES_3KEY, AES_128, AES_192, AES_256
      dukpt_key_variant: "BIDIRECTIONAL", # required, accepts BIDIRECTIONAL, REQUEST, RESPONSE
      key_serial_number: "HexLengthBetween10And24", # required
    },
    emv_mac: {
      major_key_derivation_mode: "EMV_OPTION_A", # required, accepts EMV_OPTION_A, EMV_OPTION_B
      pan_sequence_number: "HexLengthEquals2", # required
      primary_account_number: "NumberLengthBetween12And19", # required
      session_key_derivation_mode: "EMV_COMMON_SESSION_KEY", # required, accepts EMV_COMMON_SESSION_KEY, EMV2000, AMEX, MASTERCARD_SESSION_KEY, VISA
      session_key_derivation_value: { # required
        application_cryptogram: "HexLengthEquals16",
        application_transaction_counter: "HexLengthBetween2And4",
      },
    },
  },
  key_identifier: "KeyArnOrKeyAliasType", # required
  mac_length: 1,
  message_data: "HexEvenLengthBetween2And4096", # required
})

Response structure


resp.key_arn #=> String
resp.key_check_value #=> String
resp.mac #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :generation_attributes (required, Types::MacAttributes)

    The attributes and data values to use for MAC generation within Amazon Web Services Payment Cryptography.

  • :key_identifier (required, String)

    The keyARN of the MAC generation encryption key.

  • :mac_length (Integer)

    The length of a MAC under generation.

  • :message_data (required, String)

    The data for which a MAC is under generation. This value must be hexBinary.

Returns:

See Also:



878
879
880
881
# File 'gems/aws-sdk-paymentcryptographydata/lib/aws-sdk-paymentcryptographydata/client.rb', line 878

def generate_mac(params = {}, options = {})
  req = build_request(:generate_mac, params)
  req.send_request(options)
end

#generate_pin_data(params = {}) ⇒ Types::GeneratePinDataOutput

Generates pin-related data such as PIN, PIN Verification Value (PVV), PIN Block, and PIN Offset during new card issuance or reissuance. For more information, see Generate PIN data in the Amazon Web Services Payment Cryptography User Guide.

PIN data is never transmitted in clear to or from Amazon Web Services Payment Cryptography. This operation generates PIN, PVV, or PIN Offset and then encrypts it using Pin Encryption Key (PEK) to create an EncryptedPinBlock for transmission from Amazon Web Services Payment Cryptography. This operation uses a separate Pin Verification Key (PVK) for VISA PVV generation.

For information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the Amazon Web Services Payment Cryptography User Guide.

Cross-account use: This operation can't be used across different Amazon Web Services accounts.

Related operations:

  • GenerateCardValidationData

  • TranslatePinData

  • VerifyPinData

Examples:

Request syntax with placeholder values


resp = client.generate_pin_data({
  encryption_key_identifier: "KeyArnOrKeyAliasType", # required
  generation_attributes: { # required
    ibm_3624_natural_pin: {
      decimalization_table: "NumberLengthEquals16", # required
      pin_validation_data: "NumberLengthBetween4And16", # required
      pin_validation_data_pad_character: "HexLengthEquals1", # required
    },
    ibm_3624_pin_from_offset: {
      decimalization_table: "NumberLengthEquals16", # required
      pin_offset: "NumberLengthBetween4And12", # required
      pin_validation_data: "NumberLengthBetween4And16", # required
      pin_validation_data_pad_character: "HexLengthEquals1", # required
    },
    ibm_3624_pin_offset: {
      decimalization_table: "NumberLengthEquals16", # required
      encrypted_pin_block: "HexLengthBetween16And32", # required
      pin_validation_data: "NumberLengthBetween4And16", # required
      pin_validation_data_pad_character: "HexLengthEquals1", # required
    },
    ibm_3624_random_pin: {
      decimalization_table: "NumberLengthEquals16", # required
      pin_validation_data: "NumberLengthBetween4And16", # required
      pin_validation_data_pad_character: "HexLengthEquals1", # required
    },
    visa_pin: {
      pin_verification_key_index: 1, # required
    },
    visa_pin_verification_value: {
      encrypted_pin_block: "HexLengthBetween16And32", # required
      pin_verification_key_index: 1, # required
    },
  },
  generation_key_identifier: "KeyArnOrKeyAliasType", # required
  pin_block_format: "ISO_FORMAT_0", # required, accepts ISO_FORMAT_0, ISO_FORMAT_3
  pin_data_length: 1,
  primary_account_number: "NumberLengthBetween12And19", # required
})

Response structure


resp.encrypted_pin_block #=> String
resp.encryption_key_arn #=> String
resp.encryption_key_check_value #=> String
resp.generation_key_arn #=> String
resp.generation_key_check_value #=> String
resp.pin_data.pin_offset #=> String
resp.pin_data.verification_value #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :encryption_key_identifier (required, String)

    The keyARN of the PEK that Amazon Web Services Payment Cryptography uses to encrypt the PIN Block.

  • :generation_attributes (required, Types::PinGenerationAttributes)

    The attributes and values to use for PIN, PVV, or PIN Offset generation.

  • :generation_key_identifier (required, String)

    The keyARN of the PEK that Amazon Web Services Payment Cryptography uses for pin data generation.

  • :pin_block_format (required, String)

    The PIN encoding format for pin data generation as specified in ISO 9564. Amazon Web Services Payment Cryptography supports ISO_Format_0 and ISO_Format_3.

    The ISO_Format_0 PIN block format is equivalent to the ANSI X9.8, VISA-1, and ECI-1 PIN block formats. It is similar to a VISA-4 PIN block format. It supports a PIN from 4 to 12 digits in length.

    The ISO_Format_3 PIN block format is the same as ISO_Format_0 except that the fill digits are random values from 10 to 15.

  • :pin_data_length (Integer)

    The length of PIN under generation.

  • :primary_account_number (required, String)

    The Primary Account Number (PAN), a unique identifier for a payment credit or debit card that associates the card with a specific account holder.

Returns:

See Also:



1013
1014
1015
1016
# File 'gems/aws-sdk-paymentcryptographydata/lib/aws-sdk-paymentcryptographydata/client.rb', line 1013

def generate_pin_data(params = {}, options = {})
  req = build_request(:generate_pin_data, params)
  req.send_request(options)
end

#re_encrypt_data(params = {}) ⇒ Types::ReEncryptDataOutput

Re-encrypt ciphertext using DUKPT, Symmetric and Asymmetric Data Encryption Keys.

You can either generate an encryption key within Amazon Web Services Payment Cryptography by calling CreateKey or import your own encryption key by calling ImportKey. The KeyArn for use with this operation must be in a compatible key state with KeyModesOfUse set to Encrypt. In asymmetric encryption, ciphertext is encrypted using public component (imported by calling ImportKey) of the asymmetric key pair created outside of Amazon Web Services Payment Cryptography.

For symmetric and DUKPT encryption, Amazon Web Services Payment Cryptography supports TDES and AES algorithms. For asymmetric encryption, Amazon Web Services Payment Cryptography supports RSA. To encrypt using DUKPT, a DUKPT key must already exist within your account with KeyModesOfUse set to DeriveKey or a new DUKPT can be generated by calling CreateKey.

For information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the Amazon Web Services Payment Cryptography User Guide.

Cross-account use: This operation can't be used across different Amazon Web Services accounts.

Related operations:

Examples:

Request syntax with placeholder values


resp = client.re_encrypt_data({
  cipher_text: "HexEvenLengthBetween16And4096", # required
  incoming_encryption_attributes: { # required
    dukpt: {
      dukpt_key_derivation_type: "TDES_2KEY", # accepts TDES_2KEY, TDES_3KEY, AES_128, AES_192, AES_256
      dukpt_key_variant: "BIDIRECTIONAL", # accepts BIDIRECTIONAL, REQUEST, RESPONSE
      initialization_vector: "HexLength16Or32",
      key_serial_number: "HexLengthBetween10And24", # required
      mode: "ECB", # accepts ECB, CBC
    },
    symmetric: {
      initialization_vector: "HexLength16Or32",
      mode: "ECB", # required, accepts ECB, CBC, CFB, CFB1, CFB8, CFB64, CFB128, OFB
      padding_type: "PKCS1", # accepts PKCS1, OAEP_SHA1, OAEP_SHA256, OAEP_SHA512
    },
  },
  incoming_key_identifier: "KeyArnOrKeyAliasType", # required
  outgoing_encryption_attributes: { # required
    dukpt: {
      dukpt_key_derivation_type: "TDES_2KEY", # accepts TDES_2KEY, TDES_3KEY, AES_128, AES_192, AES_256
      dukpt_key_variant: "BIDIRECTIONAL", # accepts BIDIRECTIONAL, REQUEST, RESPONSE
      initialization_vector: "HexLength16Or32",
      key_serial_number: "HexLengthBetween10And24", # required
      mode: "ECB", # accepts ECB, CBC
    },
    symmetric: {
      initialization_vector: "HexLength16Or32",
      mode: "ECB", # required, accepts ECB, CBC, CFB, CFB1, CFB8, CFB64, CFB128, OFB
      padding_type: "PKCS1", # accepts PKCS1, OAEP_SHA1, OAEP_SHA256, OAEP_SHA512
    },
  },
  outgoing_key_identifier: "KeyArnOrKeyAliasType", # required
})

Response structure


resp.cipher_text #=> String
resp.key_arn #=> String
resp.key_check_value #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :cipher_text (required, String)

    Ciphertext to be encrypted. The minimum allowed length is 16 bytes and maximum allowed length is 4096 bytes.

  • :incoming_encryption_attributes (required, Types::ReEncryptionAttributes)

    The attributes and values for incoming ciphertext.

  • :incoming_key_identifier (required, String)

    The keyARN of the encryption key of incoming ciphertext data.

  • :outgoing_encryption_attributes (required, Types::ReEncryptionAttributes)

    The attributes and values for outgoing ciphertext data after encryption by Amazon Web Services Payment Cryptography.

  • :outgoing_key_identifier (required, String)

    The keyARN of the encryption key of outgoing ciphertext data after encryption by Amazon Web Services Payment Cryptography.

Returns:

See Also:



1133
1134
1135
1136
# File 'gems/aws-sdk-paymentcryptographydata/lib/aws-sdk-paymentcryptographydata/client.rb', line 1133

def re_encrypt_data(params = {}, options = {})
  req = build_request(:re_encrypt_data, params)
  req.send_request(options)
end

#translate_pin_data(params = {}) ⇒ Types::TranslatePinDataOutput

Translates encrypted PIN block from and to ISO 9564 formats 0,1,3,4. For more information, see Translate PIN data in the Amazon Web Services Payment Cryptography User Guide.

PIN block translation involves changing the encrytion of PIN block from one encryption key to another encryption key and changing PIN block format from one to another without PIN block data leaving Amazon Web Services Payment Cryptography. The encryption key transformation can be from PEK (Pin Encryption Key) to BDK (Base Derivation Key) for DUKPT or from BDK for DUKPT to PEK. Amazon Web Services Payment Cryptography supports TDES and AES key derivation type for DUKPT translations.

The allowed combinations of PIN block format translations are guided by PCI. It is important to note that not all encrypted PIN block formats (example, format 1) require PAN (Primary Account Number) as input. And as such, PIN block format that requires PAN (example, formats 0,3,4) cannot be translated to a format (format 1) that does not require a PAN for generation.

For information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the Amazon Web Services Payment Cryptography User Guide.

Amazon Web Services Payment Cryptography currently supports ISO PIN block 4 translation for PIN block built using legacy PAN length. That is, PAN is the right most 12 digits excluding the check digits.

Cross-account use: This operation can't be used across different Amazon Web Services accounts.

Related operations:

  • GeneratePinData

  • VerifyPinData

Examples:

Request syntax with placeholder values


resp = client.translate_pin_data({
  encrypted_pin_block: "HexEvenLengthBetween16And32", # required
  incoming_dukpt_attributes: {
    dukpt_key_derivation_type: "TDES_2KEY", # accepts TDES_2KEY, TDES_3KEY, AES_128, AES_192, AES_256
    dukpt_key_variant: "BIDIRECTIONAL", # accepts BIDIRECTIONAL, REQUEST, RESPONSE
    key_serial_number: "HexLengthBetween10And24", # required
  },
  incoming_key_identifier: "KeyArnOrKeyAliasType", # required
  incoming_translation_attributes: { # required
    iso_format_0: {
      primary_account_number: "NumberLengthBetween12And19", # required
    },
    iso_format_1: {
    },
    iso_format_3: {
      primary_account_number: "NumberLengthBetween12And19", # required
    },
    iso_format_4: {
      primary_account_number: "NumberLengthBetween12And19", # required
    },
  },
  outgoing_dukpt_attributes: {
    dukpt_key_derivation_type: "TDES_2KEY", # accepts TDES_2KEY, TDES_3KEY, AES_128, AES_192, AES_256
    dukpt_key_variant: "BIDIRECTIONAL", # accepts BIDIRECTIONAL, REQUEST, RESPONSE
    key_serial_number: "HexLengthBetween10And24", # required
  },
  outgoing_key_identifier: "KeyArnOrKeyAliasType", # required
  outgoing_translation_attributes: { # required
    iso_format_0: {
      primary_account_number: "NumberLengthBetween12And19", # required
    },
    iso_format_1: {
    },
    iso_format_3: {
      primary_account_number: "NumberLengthBetween12And19", # required
    },
    iso_format_4: {
      primary_account_number: "NumberLengthBetween12And19", # required
    },
  },
})

Response structure


resp.key_arn #=> String
resp.key_check_value #=> String
resp.pin_block #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :encrypted_pin_block (required, String)

    The encrypted PIN block data that Amazon Web Services Payment Cryptography translates.

  • :incoming_dukpt_attributes (Types::DukptDerivationAttributes)

    The attributes and values to use for incoming DUKPT encryption key for PIN block translation.

  • :incoming_key_identifier (required, String)

    The keyARN of the encryption key under which incoming PIN block data is encrypted. This key type can be PEK or BDK.

  • :incoming_translation_attributes (required, Types::TranslationIsoFormats)

    The format of the incoming PIN block data for translation within Amazon Web Services Payment Cryptography.

  • :outgoing_dukpt_attributes (Types::DukptDerivationAttributes)

    The attributes and values to use for outgoing DUKPT encryption key after PIN block translation.

  • :outgoing_key_identifier (required, String)

    The keyARN of the encryption key for encrypting outgoing PIN block data. This key type can be PEK or BDK.

  • :outgoing_translation_attributes (required, Types::TranslationIsoFormats)

    The format of the outgoing PIN block data after translation by Amazon Web Services Payment Cryptography.

Returns:

See Also:



1272
1273
1274
1275
# File 'gems/aws-sdk-paymentcryptographydata/lib/aws-sdk-paymentcryptographydata/client.rb', line 1272

def translate_pin_data(params = {}, options = {})
  req = build_request(:translate_pin_data, params)
  req.send_request(options)
end

#verify_auth_request_cryptogram(params = {}) ⇒ Types::VerifyAuthRequestCryptogramOutput

Verifies Authorization Request Cryptogram (ARQC) for a EMV chip payment card authorization. For more information, see Verify auth request cryptogram in the Amazon Web Services Payment Cryptography User Guide.

ARQC generation is done outside of Amazon Web Services Payment Cryptography and is typically generated on a point of sale terminal for an EMV chip card to obtain payment authorization during transaction time. For ARQC verification, you must first import the ARQC generated outside of Amazon Web Services Payment Cryptography by calling ImportKey. This operation uses the imported ARQC and an major encryption key (DUKPT) created by calling CreateKey to either provide a boolean ARQC verification result or provide an APRC (Authorization Response Cryptogram) response using Method 1 or Method 2. The ARPC_METHOD_1 uses AuthResponseCode to generate ARPC and ARPC_METHOD_2 uses CardStatusUpdate to generate ARPC.

For information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the Amazon Web Services Payment Cryptography User Guide.

Cross-account use: This operation can't be used across different Amazon Web Services accounts.

Related operations:

  • VerifyCardValidationData

  • VerifyPinData

Examples:

Request syntax with placeholder values


resp = client.verify_auth_request_cryptogram({
  auth_request_cryptogram: "HexLengthEquals16", # required
  auth_response_attributes: {
    arpc_method_1: {
      auth_response_code: "HexLengthEquals4", # required
    },
    arpc_method_2: {
      card_status_update: "HexLengthEquals8", # required
      proprietary_authentication_data: "HexLengthBetween1And16",
    },
  },
  key_identifier: "KeyArnOrKeyAliasType", # required
  major_key_derivation_mode: "EMV_OPTION_A", # required, accepts EMV_OPTION_A, EMV_OPTION_B
  session_key_derivation_attributes: { # required
    amex: {
      pan_sequence_number: "HexLengthEquals2", # required
      primary_account_number: "NumberLengthBetween12And19", # required
    },
    emv_2000: {
      application_transaction_counter: "HexLengthBetween2And4", # required
      pan_sequence_number: "HexLengthEquals2", # required
      primary_account_number: "NumberLengthBetween12And19", # required
    },
    emv_common: {
      application_transaction_counter: "HexLengthBetween2And4", # required
      pan_sequence_number: "HexLengthEquals2", # required
      primary_account_number: "NumberLengthBetween12And19", # required
    },
    mastercard: {
      application_transaction_counter: "HexLengthBetween2And4", # required
      pan_sequence_number: "HexLengthEquals2", # required
      primary_account_number: "NumberLengthBetween12And19", # required
      unpredictable_number: "HexLengthBetween2And8", # required
    },
    visa: {
      pan_sequence_number: "HexLengthEquals2", # required
      primary_account_number: "NumberLengthBetween12And19", # required
    },
  },
  transaction_data: "HexLengthBetween2And1024", # required
})

Response structure


resp.auth_response_value #=> String
resp.key_arn #=> String
resp.key_check_value #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :auth_request_cryptogram (required, String)

    The auth request cryptogram imported into Amazon Web Services Payment Cryptography for ARQC verification using a major encryption key and transaction data.

  • :auth_response_attributes (Types::CryptogramAuthResponse)

    The attributes and values for auth request cryptogram verification. These parameters are required in case using ARPC Method 1 or Method 2 for ARQC verification.

  • :key_identifier (required, String)

    The keyARN of the major encryption key that Amazon Web Services Payment Cryptography uses for ARQC verification.

  • :major_key_derivation_mode (required, String)

    The method to use when deriving the major encryption key for ARQC verification within Amazon Web Services Payment Cryptography. The same key derivation mode was used for ARQC generation outside of Amazon Web Services Payment Cryptography.

  • :session_key_derivation_attributes (required, Types::SessionKeyDerivation)

    The attributes and values to use for deriving a session key for ARQC verification within Amazon Web Services Payment Cryptography. The same attributes were used for ARQC generation outside of Amazon Web Services Payment Cryptography.

  • :transaction_data (required, String)

    The transaction data that Amazon Web Services Payment Cryptography uses for ARQC verification. The same transaction is used for ARQC generation outside of Amazon Web Services Payment Cryptography.

Returns:

See Also:



1407
1408
1409
1410
# File 'gems/aws-sdk-paymentcryptographydata/lib/aws-sdk-paymentcryptographydata/client.rb', line 1407

def verify_auth_request_cryptogram(params = {}, options = {})
  req = build_request(:verify_auth_request_cryptogram, params)
  req.send_request(options)
end

#verify_card_validation_data(params = {}) ⇒ Types::VerifyCardValidationDataOutput

Verifies card-related validation data using algorithms such as Card Verification Values (CVV/CVV2), Dynamic Card Verification Values (dCVV/dCVV2) and Card Security Codes (CSC). For more information, see Verify card data in the Amazon Web Services Payment Cryptography User Guide.

This operation validates the CVV or CSC codes that is printed on a payment credit or debit card during card payment transaction. The input values are typically provided as part of an inbound transaction to an issuer or supporting platform partner. Amazon Web Services Payment Cryptography uses CVV or CSC, PAN (Primary Account Number) and expiration date of the card to check its validity during transaction processing. In this operation, the CVK (Card Verification Key) encryption key for use with card data verification is same as the one in used for GenerateCardValidationData.

For information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the Amazon Web Services Payment Cryptography User Guide.

Cross-account use: This operation can't be used across different Amazon Web Services accounts.

Related operations:

  • GenerateCardValidationData

  • VerifyAuthRequestCryptogram

  • VerifyPinData

Examples:

Request syntax with placeholder values


resp = client.verify_card_validation_data({
  key_identifier: "KeyArnOrKeyAliasType", # required
  primary_account_number: "NumberLengthBetween12And19", # required
  validation_data: "NumberLengthBetween3And5", # required
  verification_attributes: { # required
    amex_card_security_code_version_1: {
      card_expiry_date: "NumberLengthEquals4", # required
    },
    amex_card_security_code_version_2: {
      card_expiry_date: "NumberLengthEquals4", # required
      service_code: "NumberLengthEquals3", # required
    },
    card_holder_verification_value: {
      application_transaction_counter: "HexLengthBetween2And4", # required
      pan_sequence_number: "HexLengthEquals2", # required
      unpredictable_number: "HexLengthBetween2And8", # required
    },
    card_verification_value_1: {
      card_expiry_date: "NumberLengthEquals4", # required
      service_code: "NumberLengthEquals3", # required
    },
    card_verification_value_2: {
      card_expiry_date: "NumberLengthEquals4", # required
    },
    discover_dynamic_card_verification_code: {
      application_transaction_counter: "HexLengthBetween2And4", # required
      card_expiry_date: "NumberLengthEquals4", # required
      unpredictable_number: "HexLengthBetween2And8", # required
    },
    dynamic_card_verification_code: {
      application_transaction_counter: "HexLengthBetween2And4", # required
      pan_sequence_number: "HexLengthEquals2", # required
      track_data: "HexLengthBetween2And160", # required
      unpredictable_number: "HexLengthBetween2And8", # required
    },
    dynamic_card_verification_value: {
      application_transaction_counter: "HexLengthBetween2And4", # required
      card_expiry_date: "NumberLengthEquals4", # required
      pan_sequence_number: "HexLengthEquals2", # required
      service_code: "NumberLengthEquals3", # required
    },
  },
})

Response structure


resp.key_arn #=> String
resp.key_check_value #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :key_identifier (required, String)

    The keyARN of the CVK encryption key that Amazon Web Services Payment Cryptography uses to verify card data.

  • :primary_account_number (required, String)

    The Primary Account Number (PAN), a unique identifier for a payment credit or debit card that associates the card with a specific account holder.

  • :validation_data (required, String)

    The CVV or CSC value for use for card data verification within Amazon Web Services Payment Cryptography.

  • :verification_attributes (required, Types::CardVerificationAttributes)

    The algorithm to use for verification of card data within Amazon Web Services Payment Cryptography.

Returns:

See Also:



1527
1528
1529
1530
# File 'gems/aws-sdk-paymentcryptographydata/lib/aws-sdk-paymentcryptographydata/client.rb', line 1527

def verify_card_validation_data(params = {}, options = {})
  req = build_request(:verify_card_validation_data, params)
  req.send_request(options)
end

#verify_mac(params = {}) ⇒ Types::VerifyMacOutput

Verifies a Message Authentication Code (MAC).

You can use this operation to verify MAC for message data authentication such as . In this operation, you must use the same message data, secret encryption key and MAC algorithm that was used to generate MAC. You can use this operation to verify a DUPKT, CMAC, HMAC or EMV MAC by setting generation attributes and algorithm to the associated values.

For information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the Amazon Web Services Payment Cryptography User Guide.

Cross-account use: This operation can't be used across different Amazon Web Services accounts.

Related operations:

  • GenerateMac

^

Examples:

Request syntax with placeholder values


resp = client.verify_mac({
  key_identifier: "KeyArnOrKeyAliasType", # required
  mac: "HexEvenLengthBetween4And128", # required
  mac_length: 1,
  message_data: "HexEvenLengthBetween2And4096", # required
  verification_attributes: { # required
    algorithm: "ISO9797_ALGORITHM1", # accepts ISO9797_ALGORITHM1, ISO9797_ALGORITHM3, CMAC, HMAC_SHA224, HMAC_SHA256, HMAC_SHA384, HMAC_SHA512
    dukpt_cmac: {
      dukpt_derivation_type: "TDES_2KEY", # accepts TDES_2KEY, TDES_3KEY, AES_128, AES_192, AES_256
      dukpt_key_variant: "BIDIRECTIONAL", # required, accepts BIDIRECTIONAL, REQUEST, RESPONSE
      key_serial_number: "HexLengthBetween10And24", # required
    },
    dukpt_iso_9797_algorithm_1: {
      dukpt_derivation_type: "TDES_2KEY", # accepts TDES_2KEY, TDES_3KEY, AES_128, AES_192, AES_256
      dukpt_key_variant: "BIDIRECTIONAL", # required, accepts BIDIRECTIONAL, REQUEST, RESPONSE
      key_serial_number: "HexLengthBetween10And24", # required
    },
    dukpt_iso_9797_algorithm_3: {
      dukpt_derivation_type: "TDES_2KEY", # accepts TDES_2KEY, TDES_3KEY, AES_128, AES_192, AES_256
      dukpt_key_variant: "BIDIRECTIONAL", # required, accepts BIDIRECTIONAL, REQUEST, RESPONSE
      key_serial_number: "HexLengthBetween10And24", # required
    },
    emv_mac: {
      major_key_derivation_mode: "EMV_OPTION_A", # required, accepts EMV_OPTION_A, EMV_OPTION_B
      pan_sequence_number: "HexLengthEquals2", # required
      primary_account_number: "NumberLengthBetween12And19", # required
      session_key_derivation_mode: "EMV_COMMON_SESSION_KEY", # required, accepts EMV_COMMON_SESSION_KEY, EMV2000, AMEX, MASTERCARD_SESSION_KEY, VISA
      session_key_derivation_value: { # required
        application_cryptogram: "HexLengthEquals16",
        application_transaction_counter: "HexLengthBetween2And4",
      },
    },
  },
})

Response structure


resp.key_arn #=> String
resp.key_check_value #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :key_identifier (required, String)

    The keyARN of the encryption key that Amazon Web Services Payment Cryptography uses to verify MAC data.

  • :mac (required, String)

    The MAC being verified.

  • :mac_length (Integer)

    The length of the MAC.

  • :message_data (required, String)

    The data on for which MAC is under verification. This value must be hexBinary.

  • :verification_attributes (required, Types::MacAttributes)

    The attributes and data values to use for MAC verification within Amazon Web Services Payment Cryptography.

Returns:

See Also:



1629
1630
1631
1632
# File 'gems/aws-sdk-paymentcryptographydata/lib/aws-sdk-paymentcryptographydata/client.rb', line 1629

def verify_mac(params = {}, options = {})
  req = build_request(:verify_mac, params)
  req.send_request(options)
end

#verify_pin_data(params = {}) ⇒ Types::VerifyPinDataOutput

Verifies pin-related data such as PIN and PIN Offset using algorithms including VISA PVV and IBM3624. For more information, see Verify PIN data in the Amazon Web Services Payment Cryptography User Guide.

This operation verifies PIN data for user payment card. A card holder PIN data is never transmitted in clear to or from Amazon Web Services Payment Cryptography. This operation uses PIN Verification Key (PVK) for PIN or PIN Offset generation and then encrypts it using PIN Encryption Key (PEK) to create an EncryptedPinBlock for transmission from Amazon Web Services Payment Cryptography.

For information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the Amazon Web Services Payment Cryptography User Guide.

Cross-account use: This operation can't be used across different Amazon Web Services accounts.

Related operations:

  • GeneratePinData

  • TranslatePinData

Examples:

Request syntax with placeholder values


resp = client.verify_pin_data({
  dukpt_attributes: {
    dukpt_derivation_type: "TDES_2KEY", # required, accepts TDES_2KEY, TDES_3KEY, AES_128, AES_192, AES_256
    key_serial_number: "HexLengthBetween10And24", # required
  },
  encrypted_pin_block: "HexLengthBetween16And32", # required
  encryption_key_identifier: "KeyArnOrKeyAliasType", # required
  pin_block_format: "ISO_FORMAT_0", # required, accepts ISO_FORMAT_0, ISO_FORMAT_3
  pin_data_length: 1,
  primary_account_number: "NumberLengthBetween12And19", # required
  verification_attributes: { # required
    ibm_3624_pin: {
      decimalization_table: "NumberLengthEquals16", # required
      pin_offset: "NumberLengthBetween4And12", # required
      pin_validation_data: "NumberLengthBetween4And16", # required
      pin_validation_data_pad_character: "HexLengthEquals1", # required
    },
    visa_pin: {
      pin_verification_key_index: 1, # required
      verification_value: "NumberLengthBetween4And12", # required
    },
  },
  verification_key_identifier: "KeyArnOrKeyAliasType", # required
})

Response structure


resp.encryption_key_arn #=> String
resp.encryption_key_check_value #=> String
resp.verification_key_arn #=> String
resp.verification_key_check_value #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :dukpt_attributes (Types::DukptAttributes)

    The attributes and values for the DUKPT encrypted PIN block data.

  • :encrypted_pin_block (required, String)

    The encrypted PIN block data that Amazon Web Services Payment Cryptography verifies.

  • :encryption_key_identifier (required, String)

    The keyARN of the encryption key under which the PIN block data is encrypted. This key type can be PEK or BDK.

  • :pin_block_format (required, String)

    The PIN encoding format for pin data generation as specified in ISO 9564. Amazon Web Services Payment Cryptography supports ISO_Format_0 and ISO_Format_3.

    The ISO_Format_0 PIN block format is equivalent to the ANSI X9.8, VISA-1, and ECI-1 PIN block formats. It is similar to a VISA-4 PIN block format. It supports a PIN from 4 to 12 digits in length.

    The ISO_Format_3 PIN block format is the same as ISO_Format_0 except that the fill digits are random values from 10 to 15.

  • :pin_data_length (Integer)

    The length of PIN being verified.

  • :primary_account_number (required, String)

    The Primary Account Number (PAN), a unique identifier for a payment credit or debit card that associates the card with a specific account holder.

  • :verification_attributes (required, Types::PinVerificationAttributes)

    The attributes and values for PIN data verification.

  • :verification_key_identifier (required, String)

    The keyARN of the PIN verification key.

Returns:

See Also:



1747
1748
1749
1750
# File 'gems/aws-sdk-paymentcryptographydata/lib/aws-sdk-paymentcryptographydata/client.rb', line 1747

def verify_pin_data(params = {}, options = {})
  req = build_request(:verify_pin_data, params)
  req.send_request(options)
end