Sha256: 2b135155f389041e926305832ccd4ea1e5b454b6b9f10eba225c4e24232245b7

Contents?: true

Size: 1013 Bytes

Versions: 3

Compression:

Stored size: 1013 Bytes

Contents


module CcipherFactory
  module SymKeySigner
    include TR::CondUtils

    class SKSigner; end

    class SymKeySignerError < StandardError; end

    def self.signer
      s = SKSigner.new
      s.extend(CcipherFactory::SymKeySigner::SymKeySign)
      s.init if s.respond_to?(:init)
      s
    end

    def self.att_signer
      s = SKSigner.new
      s.extend(SymKeyAttSign)
      s.init if s.respond_to?(:init)
      s
    end

    def self.verifier
      s = SKSigner.new
      s.extend(SymKeyVerify)
      s.init if s.respond_to?(:init)
      s
    end

    def self.att_verifier
      s = SKSigner.new
      s.extend(SymKeyAttVerify)
      s.init if s.respond_to?(:init)
      s
    end

    def SymKeySigner.algo_default(algo)

      case algo
      when :ecc
        { curve: :prime256v1 }
      when :rsa
        { keysize: 2048  }
      end

    end

  end
end


require_relative 'symkey_sign'
require_relative 'symkey_verify'

require_relative 'symkey_att_sign'
require_relative 'symkey_att_verify'

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ccipher_factory-0.1.2 lib/ccipher_factory/symkey_cipher/symkey_signer.rb
ccipher_factory-0.1.1 lib/ccipher_factory/symkey_cipher/symkey_signer.rb
ccipher_factory-0.1.0 lib/ccipher_factory/symkey_cipher/symkey_signer.rb