Module: IosAppAttest::Validators::Utils
- Defined in:
- lib/ios_app_attest/validators/utils.rb
Overview
Utility methods for iOS App Attest validators
This module provides common cryptographic and encoding utilities used throughout the iOS App Attest validation process. It includes methods for base64 encoding/decoding, SHA256 hashing, and AES cipher creation.
Class Method Summary collapse
-
.cipher ⇒ OpenSSL::Cipher
Create AES cipher.
-
.decode_base64(base64_string) ⇒ String
Decode base64 string.
-
.encode_base64(string) ⇒ String
Encode base64 string.
-
.sha256 ⇒ OpenSSL::Digest
Get SHA256 digest.
Class Method Details
.cipher ⇒ OpenSSL::Cipher
Create AES cipher
34 35 36 |
# File 'lib/ios_app_attest/validators/utils.rb', line 34 def self.cipher OpenSSL::Cipher::AES256.new(:CBC) end |
.decode_base64(base64_string) ⇒ String
Decode base64 string
15 16 17 |
# File 'lib/ios_app_attest/validators/utils.rb', line 15 def self.decode_base64(base64_string) Base64.strict_decode64(base64_string) end |
.encode_base64(string) ⇒ String
Encode base64 string
22 23 24 |
# File 'lib/ios_app_attest/validators/utils.rb', line 22 def self.encode_base64(string) Base64.strict_encode64(string) end |
.sha256 ⇒ OpenSSL::Digest
Get SHA256 digest
28 29 30 |
# File 'lib/ios_app_attest/validators/utils.rb', line 28 def self.sha256 OpenSSL::Digest.new('SHA256') end |