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.ws.security.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(X509Certificate[] certs) {
46 this.certs = certs;
47 }
48
49 public SAMLKeyInfo(byte[] secret) {
50 this.secret = secret;
51 }
52
53 public SAMLKeyInfo(PublicKey publicKey) {
54 this.publicKey = publicKey;
55 }
56
57 public X509Certificate[] getCerts() {
58 return certs;
59 }
60
61 public void setCerts(X509Certificate[] certs) {
62 this.certs = certs;
63 }
64
65 public byte[] getSecret() {
66 return secret;
67 }
68
69 public void setSecret(byte[] secret) {
70 this.secret = secret;
71 }
72
73 public PublicKey getPublicKey() {
74 return this.publicKey;
75 }
76
77 public void setPublicKey(PublicKey publicKey) {
78 this.publicKey = publicKey;
79 }
80
81 }