Sha256: a01c99044df53164578bcc81e583d26a623a9b431c28d7b5348ce46295316af8
Contents?: true
Size: 1006 Bytes
Versions: 1
Compression:
Stored size: 1006 Bytes
Contents
# frozen_string_literal: true require 'sinatra' require 'yaml' require 'sinatra/base' require 'webrick' require 'webrick/https' require 'openssl' require 'ruby_scep' RubyScep.configure do |config| config.ca_cert_path = 'certs/ca.pem' config.ca_key_path = 'certs/passwordless.key' end get '/scep' do p 'get scep' case params['operation'] when 'GetCACert' p 'operation: GetCACert' # todo, verify signer content_type 'application/x-x509-ca-cert' RubyScep.configuration.ca.to_der when 'GetCACaps' p 'operation: GetCACaps' content_type 'text/plain' "SHA-1\nSHA-256\nAES\nDES3\nSCEPStandard\nPOSTPKIOperation" # see complete list of capabilities https://tools.ietf.org/html/draft-nourse-scep-23#appendix-C.2 else 'Invalid Action' end end post '/scep' do p 'post scep' if params['operation'] == 'PKIOperation' content_type 'application/x-pki-message' RubyScep::PkiOperation.build_response(request.body.read) else 'Invalid Action' end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ruby_scep-0.1.0 | example_server/application.rb |