1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.crypto.script

File X509NameScriptService.java

 

Coverage histogram

../../../../img/srcFileCovDistChart0.png
83% of files have more coverage

Code metrics

0
4
4
1
90
31
4
1
1
4
1

Classes

Class Line # Actions
X509NameScriptService 44 4 0% 4 8
0.00%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.crypto.script;
21   
22    import javax.inject.Named;
23    import javax.inject.Singleton;
24   
25    import org.xwiki.component.annotation.Component;
26    import org.xwiki.crypto.pkix.params.x509certificate.extension.X509DirectoryName;
27    import org.xwiki.crypto.pkix.params.x509certificate.extension.X509GeneralName;
28    import org.xwiki.crypto.pkix.params.x509certificate.extension.X509IpAddress;
29    import org.xwiki.crypto.pkix.params.x509certificate.extension.X509Rfc822Name;
30    import org.xwiki.crypto.pkix.params.x509certificate.extension.X509URI;
31    import org.xwiki.script.service.ScriptService;
32    import org.xwiki.stability.Unstable;
33   
34    /**
35    * Helper script service to create X509 names.
36    *
37    * @version $Id: 6554e1dcda282070ffd3c3767f44e3f520ceaa65 $
38    * @since 8.4RC1
39    */
40    @Component
41    @Named(CryptoScriptService.ROLEHINT + '.' + X509NameScriptService.ROLEHINT)
42    @Singleton
43    @Unstable
 
44    public class X509NameScriptService implements ScriptService
45    {
46    /**
47    * The role hint of this component.
48    */
49    public static final String ROLEHINT = "x509name";
50   
51    /**
52    * Create a new {@link X509Rfc822Name}.
53    *
54    * @param email the name.
55    * @return an typed {@link X509GeneralName}
56    */
 
57  0 toggle public X509Rfc822Name createX509Rfc822Name(String email) {
58  0 return new X509Rfc822Name(email);
59    }
60   
61    /**
62    * Create a new {@link X509DirectoryName}.
63    *
64    * @param dn the name.
65    * @return an typed {@link X509GeneralName}
66    */
 
67  0 toggle public X509DirectoryName createX509DirectoryName(String dn) {
68  0 return new X509DirectoryName(dn);
69    }
70   
71    /**
72    * Create a new {@link X509IpAddress}.
73    *
74    * @param ip the name.
75    * @return an typed {@link X509GeneralName}
76    */
 
77  0 toggle public X509IpAddress createX509IpAddress(String ip) {
78  0 return new X509IpAddress(ip);
79    }
80   
81    /**
82    * Create a new {@link X509URI}.
83    *
84    * @param uri the name.
85    * @return an typed {@link X509GeneralName}
86    */
 
87  0 toggle public X509URI createX509URI(String uri) {
88  0 return new X509URI(uri);
89    }
90    }