View Javadoc
1   /*
2    * GordianKnot: Security Suite
3    * Copyright 2012-2026. Tony Washer
4    *
5    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6    * use this file except in compliance with the License.  You may obtain a copy
7    * of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
14   * License for the specific language governing permissions and limitations under
15   * the License.
16   */
17  package io.github.tonywasher.joceanus.gordianknot.api.agree;
18  
19  import io.github.tonywasher.joceanus.gordianknot.api.agree.spec.GordianAgreementSpec;
20  import io.github.tonywasher.joceanus.gordianknot.api.base.GordianException;
21  import io.github.tonywasher.joceanus.gordianknot.api.cert.GordianCertificate;
22  import io.github.tonywasher.joceanus.gordianknot.api.sign.spec.GordianSignatureSpec;
23  
24  /**
25   * Key Agreement Parameters Specification.
26   */
27  public interface GordianAgreementParams {
28      /**
29       * Obtain the agreementSpec.
30       *
31       * @return the spec
32       */
33      GordianAgreementSpec getAgreementSpec();
34  
35      /**
36       * Obtain the resultType.
37       *
38       * @return the resultType
39       */
40      Object getResultType();
41  
42      /**
43       * Obtain the clientCertificate.
44       *
45       * @return the certificate
46       */
47      GordianCertificate getClientCertificate();
48  
49      /**
50       * Obtain the serverCertificate.
51       *
52       * @return the certificate
53       */
54      GordianCertificate getServerCertificate();
55  
56      /**
57       * Obtain the signerCertificate.
58       *
59       * @return the certificate
60       */
61      GordianCertificate getSignerCertificate();
62  
63      /**
64       * Obtain the signatureSpec.
65       *
66       * @return the signatureSpec
67       */
68      GordianSignatureSpec getSignatureSpec();
69  
70      /**
71       * Obtain the additionalData.
72       *
73       * @return the additional data
74       */
75      byte[] getAdditionalData();
76  
77      /**
78       * Obtain the clientName.
79       *
80       * @return the clientName
81       */
82      byte[] getClientName();
83  
84      /**
85       * Obtain the serverName.
86       *
87       * @return the serverName
88       */
89      byte[] getServerName();
90  
91      /**
92       * Set client Certificate.
93       *
94       * @param pClient the client certificate
95       * @return the new agreementParams
96       * @throws GordianException on error
97       */
98      GordianAgreementParams setClientCertificate(GordianCertificate pClient) throws GordianException;
99  
100     /**
101      * Set server Certificate.
102      *
103      * @param pServer the server certificate
104      * @return the new agreementParams
105      * @throws GordianException on error
106      */
107     GordianAgreementParams setServerCertificate(GordianCertificate pServer) throws GordianException;
108 
109     /**
110      * Declare signer certificate.
111      *
112      * @param pSigner the certificate
113      * @return the new agreementParams
114      * @throws GordianException on error
115      */
116     GordianAgreementParams setSigner(GordianCertificate pSigner) throws GordianException;
117 
118     /**
119      * Declare signer certificate and specification.
120      *
121      * @param pSigner   the certificate
122      * @param pSignSpec the signSpec
123      * @return the new agreementParams
124      * @throws GordianException on error
125      */
126     GordianAgreementParams setSigner(GordianCertificate pSigner,
127                                      GordianSignatureSpec pSignSpec) throws GordianException;
128 
129     /**
130      * Set additional data.
131      *
132      * @param pData the additional data
133      * @return the new agreementParams
134      * @throws GordianException on error
135      */
136     GordianAgreementParams setAdditionalData(byte[] pData) throws GordianException;
137 
138     /**
139      * Set clientName.
140      *
141      * @param pName the clientName
142      * @return the new agreementParams
143      * @throws GordianException on error
144      */
145     GordianAgreementParams setClientName(byte[] pName) throws GordianException;
146 
147     /**
148      * Set serverName.
149      *
150      * @param pName the serverName
151      * @return the new agreementParams
152      * @throws GordianException on error
153      */
154     GordianAgreementParams setServerName(byte[] pName) throws GordianException;
155 }