Skip to content

Commit 61410ac

Browse files
committed
ts: fix docs for attrs on OpenSSL::Timestamp::Factory
Move attribute documentation out of the class-level section and into the appropriate sections so that they attach correctly.
1 parent 7b1668e commit 61410ac

File tree

1 file changed

+25
-51
lines changed

1 file changed

+25
-51
lines changed

ext/openssl/ossl_ts.c

Lines changed: 25 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,65 +1511,39 @@ Init_ossl_ts(void)
15111511
* fac.default_policy_id = '1.2.3.4.5'
15121512
* fac.additional_certificates = [ inter1, inter2 ]
15131513
* timestamp = fac.create_timestamp(p12.key, p12.certificate, req)
1514-
*
1515-
* ==Attributes
1516-
*
1517-
* ===default_policy_id
1514+
*/
1515+
cTimestampFactory = rb_define_class_under(mTimestamp, "Factory", rb_cObject);
1516+
/*
1517+
* The list of digest algorithms that the factory is allowed
1518+
* create timestamps for. Known vulnerable or weak algorithms should not be
1519+
* allowed where possible. Must be an Array of String or OpenSSL::Digest
1520+
* subclass instances.
1521+
*/
1522+
rb_attr(cTimestampFactory, rb_intern_const("allowed_digests"), 1, 1, 0);
1523+
/*
1524+
* A String representing the default policy object identifier, or +nil+.
15181525
*
15191526
* Request#policy_id will always be preferred over this if present in the
1520-
* Request, only if Request#policy_id is nil default_policy will be used.
1527+
* Request, only if Request#policy_id is +nil+ default_policy will be used.
15211528
* If none of both is present, a TimestampError will be raised when trying
15221529
* to create a Response.
1523-
*
1524-
* call-seq:
1525-
* factory.default_policy_id = "string" -> string
1526-
* factory.default_policy_id -> string or nil
1527-
*
1528-
* ===serial_number
1529-
*
1530-
* Sets or retrieves the serial number to be used for timestamp creation.
1531-
* Must be present for timestamp creation.
1532-
*
1533-
* call-seq:
1534-
* factory.serial_number = number -> number
1535-
* factory.serial_number -> number or nil
1536-
*
1537-
* ===gen_time
1538-
*
1539-
* Sets or retrieves the Time value to be used in the Response. Must be
1540-
* present for timestamp creation.
1541-
*
1542-
* call-seq:
1543-
* factory.gen_time = Time -> Time
1544-
* factory.gen_time -> Time or nil
1545-
*
1546-
* ===additional_certs
1547-
*
1548-
* Sets or retrieves additional certificates apart from the timestamp
1549-
* certificate (e.g. intermediate certificates) to be added to the Response.
1550-
* Must be an Array of OpenSSL::X509::Certificate.
1551-
*
1552-
* call-seq:
1553-
* factory.additional_certs = [cert1, cert2] -> [ cert1, cert2 ]
1554-
* factory.additional_certs -> array or nil
1555-
*
1556-
* ===allowed_digests
1557-
*
1558-
* Sets or retrieves the digest algorithms that the factory is allowed
1559-
* create timestamps for. Known vulnerable or weak algorithms should not be
1560-
* allowed where possible.
1561-
* Must be an Array of String or OpenSSL::Digest subclass instances.
1562-
*
1563-
* call-seq:
1564-
* factory.allowed_digests = ["sha1", OpenSSL::Digest.new('SHA256').new] -> [ "sha1", OpenSSL::Digest) ]
1565-
* factory.allowed_digests -> array or nil
1566-
*
15671530
*/
1568-
cTimestampFactory = rb_define_class_under(mTimestamp, "Factory", rb_cObject);
1569-
rb_attr(cTimestampFactory, rb_intern_const("allowed_digests"), 1, 1, 0);
15701531
rb_attr(cTimestampFactory, rb_intern_const("default_policy_id"), 1, 1, 0);
1532+
/*
1533+
* The serial number to be used for timestamp creation. Must be present for
1534+
* timestamp creation. Must be an instance of OpenSSL::BN or Integer.
1535+
*/
15711536
rb_attr(cTimestampFactory, rb_intern_const("serial_number"), 1, 1, 0);
1537+
/*
1538+
* The Time value to be used in the Response. Must be present for timestamp
1539+
* creation.
1540+
*/
15721541
rb_attr(cTimestampFactory, rb_intern_const("gen_time"), 1, 1, 0);
1542+
/*
1543+
* Additional certificates apart from the timestamp certificate (e.g.
1544+
* intermediate certificates) to be added to the Response.
1545+
* Must be an Array of OpenSSL::X509::Certificate, or +nil+.
1546+
*/
15731547
rb_attr(cTimestampFactory, rb_intern_const("additional_certs"), 1, 1, 0);
15741548
rb_define_method(cTimestampFactory, "create_timestamp", ossl_tsfac_create_ts, 3);
15751549
}

0 commit comments

Comments
 (0)