Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
3d449c4e
Commit
3d449c4e
authored
27 years ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
Handle certificate attributes better.
Rev: lib/modules/Standards.pmod/PKCS.pmod/Certificate.pmod:1.2
parent
8c41f54a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/Standards.pmod/PKCS.pmod/Certificate.pmod
+38
-6
38 additions, 6 deletions
lib/modules/Standards.pmod/PKCS.pmod/Certificate.pmod
with
38 additions
and
6 deletions
lib/modules/Standards.pmod/PKCS.pmod/Certificate.pmod
+
38
−
6
View file @
3d449c4e
...
...
@@ -16,7 +16,7 @@ Version ::= INTEGER
Attributes ::= SET OF Attribute
-- From the last section of PKCS-9.
Is this used???
-- From the last section of PKCS-9.
Attribute ::= SEQUENCE {
attribyteType ::= OBJECT IDENTIFIER,
attributeValue ::= SET OF ANY }
...
...
@@ -124,12 +124,12 @@ Version ::= INTEGER
*/
import
asn
1.
e
ncode;
import
i
dentifiers;
import
Standards.ASN
1.
E
ncode;
import
I
dentifiers;
class AttributeValueAssertion
{
import
asn
1.
e
ncode;
import
Standards.ASN
1.
E
ncode;
inherit asn1_sequence;
void create(mapping(string:object) types,
string type,
...
...
@@ -146,7 +146,7 @@ class AttributeValueAssertion
/* RelativeDistinguishedName */
class attribute_set
{
import
asn
1.
e
ncode;
import
Standards.ASN
1.
E
ncode;
inherit asn1_set;
void create(mapping(string:object) types, mapping(string:object) pairs)
...
...
@@ -165,6 +165,38 @@ object build_distinguished_name(mapping(string:object) ... args)
return asn1_sequence(@Array.map(args, lambda(mapping rdn)
{
return attribute_set(
i
dentifiers.name_ids, rdn);
I
dentifiers.name_ids, rdn);
} ));
}
class Attribute
{
import Standards.ASN1.Encode;
inherit asn1_sequence;
void create(mapping(string:object) types, string type,
array(object) v)
{
if (!types[type])
throw( ({ sprintf("Attribute: "
"Unknown attribute type '%s'\n",
type), backtrace() }) );
::create(types[type], asn1_set(@ v));
}
}
class Attributes
{
import Standards.ASN1.Encode;
inherit asn1_set;
void create(mapping(string:object) types, mapping(string:array(object)) m)
{
::create(@ Array.map(indices(m),
lambda(string field, mapping m, mapping t)
{
return Attribute(t, field, m[field]);
}, m, types));
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment