Sha256: 0a2693c5f66cc162506d399193cbb9c4410986e95c0560b997e398f930ed1ff4

Contents?: true

Size: 335 Bytes

Versions: 5

Compression:

Stored size: 335 Bytes

Contents

require 'securerandom'

module CertificateAuthority
  class SerialNumber
    include ActiveModel::Validations
    include Revocable

    attr_accessor :number

    validates :number, :presence => true, :numericality => {:greater_than => 0}

    def initialize
      self.number = SecureRandom.random_number(2**128-1)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
leap_cli-1.8.1 vendor/certificate_authority/lib/certificate_authority/serial_number.rb
leap_cli-1.8 vendor/certificate_authority/lib/certificate_authority/serial_number.rb
leap_cli-1.7.4 vendor/certificate_authority/lib/certificate_authority/serial_number.rb
leap_cli-1.7.3 vendor/certificate_authority/lib/certificate_authority/serial_number.rb
leap_cli-1.6.2 vendor/certificate_authority/lib/certificate_authority/serial_number.rb