diff options
author | Fraser Tweedale <ftweedal@redhat.com> | 2017-02-01 16:25:11 +1000 |
---|---|---|
committer | Fraser Tweedale <ftweedal@redhat.com> | 2017-02-08 12:24:00 +1000 |
commit | a67816eebbed2332327fbf391f3e23223ee7690e (patch) | |
tree | 756a126c5a6155f7da149198b19a7d47d9686def /base/util | |
parent | 225dd099efa7e2f752c3f50157aaec71a9834873 (diff) | |
download | pki-a67816eebbed2332327fbf391f3e23223ee7690e.tar.gz pki-a67816eebbed2332327fbf391f3e23223ee7690e.tar.xz pki-a67816eebbed2332327fbf391f3e23223ee7690e.zip |
SubjectAlternativeNameExtension: add GeneralNames getter/setter
To implement a profile default that copies CN to SAN dNSName, we
need to read and set the 'GeneralNames' of the extension. This can
be done via the 'get' and 'set' methods but this interface is
awkward and requires the caller to deal with exceptions that aren't
fundamental to the get/set actions.
Add the 'setGeneralNames' and 'getGeneralNames' methods.
Part of: https://fedorahosted.org/pki/ticket/1710
Diffstat (limited to 'base/util')
-rw-r--r-- | base/util/src/netscape/security/x509/SubjectAlternativeNameExtension.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/base/util/src/netscape/security/x509/SubjectAlternativeNameExtension.java b/base/util/src/netscape/security/x509/SubjectAlternativeNameExtension.java index d96c82160..82f87e1ef 100644 --- a/base/util/src/netscape/security/x509/SubjectAlternativeNameExtension.java +++ b/base/util/src/netscape/security/x509/SubjectAlternativeNameExtension.java @@ -199,6 +199,21 @@ public class SubjectAlternativeNameExtension extends Extension } /** + * Set the GeneralNames of this extension. + */ + public void setGeneralNames(GeneralNames names) { + clearValue(); + this.names = names; + } + + /** + * Get the GeneralNames of this extension. + */ + public GeneralNames getGeneralNames() { + return names; + } + + /** * Get the attribute value. */ public Object get(String name) throws IOException { |