View Javadoc
1   /**
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements. See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership. The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License. You may obtain a copy of the License at
9    *
10   * http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied. See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  
20  package org.apache.wss4j.common.saml;
21  
22  import java.security.PublicKey;
23  import java.security.cert.X509Certificate;
24  
25  /**
26   * This holds key/cert information extracted from a SAML assertion
27   */
28  public class SAMLKeyInfo {
29  
30      /**
31       * Certificates
32       */
33      private X509Certificate[] certs;
34  
35      /**
36       * Key bytes (e.g.: held in an encrypted key)
37       */
38      private byte[] secret;
39  
40      /**
41       * The public key {e.g.: held in a ds:KeyInfo).
42       */
43      private PublicKey publicKey;
44  
45      public SAMLKeyInfo() {
46      }
47  
48      public SAMLKeyInfo(X509Certificate[] certs) {
49          this.certs = certs;
50      }
51  
52      public SAMLKeyInfo(byte[] secret) {
53          this.secret = secret;
54      }
55  
56      public SAMLKeyInfo(PublicKey publicKey) {
57          this.publicKey = publicKey;
58      }
59  
60      public X509Certificate[] getCerts() {
61          return certs;
62      }
63  
64      public void setCerts(X509Certificate[] certs) {
65          this.certs = certs;
66      }
67  
68      public byte[] getSecret() {
69          return secret;
70      }
71  
72      public void setSecret(byte[] secret) {
73          this.secret = secret;
74      }
75  
76      public PublicKey getPublicKey() {
77          return this.publicKey;
78      }
79  
80      public void setPublicKey(PublicKey publicKey) {
81          this.publicKey = publicKey;
82      }
83  
84  }