# File lib/openid/server.rb, line 513 def create_association(assoc_type) return nil unless assoc_type == 'HMAC-SHA1' secret = OpenID::Util.get_random_bytes(20) uniq = OpenID::Util.to_base64(OpenID::Util.get_random_bytes(4)) handle = "{%s}}{%x}{%s}" % [assoc_type, Time.now.to_i, uniq] assoc = Association.from_expires_in(@@SECRET_LIFETIME, handle, secret, assoc_type) return assoc end