Roxen.git
/
server
/
config_actions
/
make_csr.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/config_actions/make_csr.pike:1:
/*
-
* $Id: make_csr.pike,v 1.
4
1997
/
12
/20
00
:
20
:
38
grubba
Exp $
+
* $Id: make_csr.pike,v 1.
5
1998
/
04
/20
04
:
36
:
10
nisse
Exp $
*/ inherit "wizard"; import Standards.PKCS; import Standards.ASN1.Encode; #if 0 #define WERROR werror #else
Roxen.git/server/config_actions/make_csr.pike:167:
return "<font color=red>Could not open key file: " + strerror(file->errno()) + "\n</font>"; } privs = 0; string s = file->read(0x10000); if (!s) return "<font color=red>Could not read private key: " + strerror(file->errno()) + "\n</font>";
-
mapping
m
=
SSL
.
pem
.
parse_
pem(s);
-
if
(!m
||
!m
["RSA PRIVATE KEY"])
+
object
msg
=
Tools
.
PEM.
pem_
msg
(
)->init(
s);
+
object
part
=
msg->parts
["RSA PRIVATE KEY"]
;
+
+
if (!part
)
return "<font color=red>Key file not formatted properly.\n</font>";
-
object rsa = RSA.parse_private_key(
m["RSA PRIVATE KEY"]
);
+
object rsa = RSA.parse_private_key(
part->decoded_body(
)
)
;
if (!rsa) return "<font color=red>Invalid key.\n</font>"; mapping attrs = ([]); string attr; /* Remove initial and trailing whitespace, and ignore * empty attributes. */ foreach( ({ "countryName", "stateOrProvinceName", "localityName", "organizationName", "organizationUnitName", "commonName",
Roxen.git/server/config_actions/make_csr.pike:222:
} csr_attrs->extendedCertificateAttributes = ({ Certificate.Attributes(Identifiers.attribute_ids, cert_attrs) }); object csr = CSR.build_csr(rsa, Certificate.build_distinguished_name(@name), csr_attrs);
-
return "<pre>" +
SSL
.
pem
.build_pem("CERTIFICATE REQUEST", csr->der())
+
return "<pre>"
+
+
Tools
.
PEM
.
simple_
build_pem("CERTIFICATE REQUEST", csr->der())
+"</pre>"; } mixed wizard_done(object id, object mc) { return 0; } mixed handle(object id) { return wizard_for(id,0); } #endif /* constant(_Crypto) && constant(Crypto.rsa) */