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

File AbstractBcAsymmetricKeyParameters.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart8.png
54% of files have more coverage

Code metrics

0
5
5
1
71
34
5
1
1
5
1

Classes

Class Line # Actions
AbstractBcAsymmetricKeyParameters 32 5 0% 5 2
0.880%
 

Contributing tests

This file is covered by 72 tests. .

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.internal.asymmetric;
21   
22    import org.apache.commons.lang3.builder.EqualsBuilder;
23    import org.bouncycastle.crypto.params.AsymmetricKeyParameter;
24    import org.xwiki.crypto.params.cipher.asymmetric.AsymmetricKeyParameters;
25   
26    /**
27    * Encapsulate a Bouncy Castle asymmetric key parameters.
28    *
29    * @version $Id: 5554a4d9e8492954feab882e1244574c63d7a777 $
30    * @since 5.4M1
31    */
 
32    public abstract class AbstractBcAsymmetricKeyParameters implements AsymmetricKeyParameters, BcAsymmetricKeyParameters
33    {
34    protected final AsymmetricKeyParameter parameters;
35   
36    /**
37    * Encapsulate a given Bouncy Castle asymmetric key parameter.
38    *
39    * @param parameters a BC asymmetric key parameter.
40    */
 
41  102 toggle public AbstractBcAsymmetricKeyParameters(AsymmetricKeyParameter parameters)
42    {
43  102 this.parameters = parameters;
44    }
45   
 
46  102 toggle @Override
47    public boolean isPrivate()
48    {
49  102 return this.parameters.isPrivate();
50    }
51   
 
52  231 toggle @Override
53    public AsymmetricKeyParameter getParameters()
54    {
55  231 return this.parameters;
56    }
57   
 
58  4 toggle @Override
59    public boolean equals(Object obj)
60    {
61  4 return this == obj
62    || (obj instanceof BcAsymmetricKeyParameters
63    && EqualsBuilder.reflectionEquals(this.parameters, ((BcAsymmetricKeyParameters) obj).getParameters()));
64    }
65   
 
66  0 toggle @Override
67    public int hashCode()
68    {
69  0 return this.parameters.hashCode();
70    }
71    }