Module: Saro::Dat
- Defined in:
- lib/saro-dat.rb,
lib/saro/dat/dat.rb,
lib/saro/dat/util.rb,
lib/saro/dat/crypto.rb,
lib/saro/dat/signature.rb,
lib/saro/dat/dat_manager.rb,
lib/saro/dat/dat_certificate.rb
Defined Under Namespace
Modules: Util
Classes: Dat, DatCertificate, DatCryptoAlgorithm, DatCryptoKey, DatManager, DatPayload, DatSignatureAlgorithm, DatSignatureKey, DatSignatureKeyExportOption, Error
Constant Summary
collapse
- CRYPTO_CONFIG =
{
"AES128GCMN" => { name: "aes-128-gcm", length: 16 },
"AES256GCMN" => { name: "aes-256-gcm", length: 32 }
}.freeze
- SIGNATURE_CONFIG =
{
"P256" => { curve: "prime256v1", hash: "SHA256" },
"P384" => { curve: "secp384r1", hash: "SHA384" },
"P521" => { curve: "secp521r1", hash: "SHA512" }
}.freeze
- CURVE_OIDS =
{
"prime256v1" => "1.2.840.10045.3.1.7",
"secp384r1" => "1.3.132.0.34",
"secp521r1" => "1.3.132.0.35"
}.freeze
Class Method Summary
collapse
Class Method Details
.get_crypto_config(algorithm) ⇒ Object
23
24
25
26
27
|
# File 'lib/saro/dat/crypto.rb', line 23
def self.get_crypto_config(algorithm)
config = CRYPTO_CONFIG[algorithm]
return config if config
raise ArgumentError, "Unsupported DAT Crypto Algorithm: #{algorithm}"
end
|
.get_signature_config(algorithm) ⇒ Object
30
31
32
33
34
|
# File 'lib/saro/dat/signature.rb', line 30
def self.get_signature_config(algorithm)
config = SIGNATURE_CONFIG[algorithm]
return config if config
raise ArgumentError, "Unsupported DAT Crypto Algorithm: #{algorithm}"
end
|