Class: IISSelfSigner

Inherits:
Object
  • Object
show all
Defined in:
lib/IIS_self_signer.rb

Instance Method Summary collapse

Constructor Details

#initialize(siteName, webSiteIdentifier = WebSiteIdentifier.new) ⇒ IISSelfSigner

Returns a new instance of IISSelfSigner.



5
6
7
8
# File 'lib/IIS_self_signer.rb', line 5

def initialize(siteName, webSiteIdentifier = WebSiteIdentifier.new)
	@siteName = siteName
	@webSiteIdentifier = webSiteIdentifier
end

Instance Method Details

#signObject



10
11
12
13
14
# File 'lib/IIS_self_signer.rb', line 10

def sign
	@siteId = @webSiteIdentifier.getId(@siteName)
	certName = @siteName+":#{(0..16).to_a.map{|a| rand(16).to_s(16)}.join}"
	`"C:\\Program Files (x86)\\IIS Resources\\SelfSSL\\selfssl.exe" /T /N:CN=#{certName} /S:#{@siteId} /Q`
end