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.principal;
21  
22  import java.security.Principal;
23  
24  /**
25   * This class implements the <code>Principal</code> interface and
26   * represents a <code>DerivedKeyToken</code>.
27   * The principal's name will be the <code>wsu:Id</code> value of the
28   * <code>DerivedKeyToken</code>
29   */
30  public class WSDerivedKeyTokenPrincipal implements java.io.Serializable, Principal {
31  
32      private static final long serialVersionUID = -8576876885462234466L;
33  
34      private String algorithm;
35      private String id;
36      private String nonce;
37      private String label;
38      private int length;
39      private int offset;
40      private String basetokenId;
41      private transient byte[] secret;
42  
43      public WSDerivedKeyTokenPrincipal(String id) {
44          this.id = id;
45      }
46  
47      public String getLabel() {
48          return label;
49      }
50  
51      public void setLabel(String label) {
52          this.label = label;
53      }
54  
55      public byte[] getSecret() {
56          return secret;
57      }
58  
59      public void setSecret(byte[] secret) {
60          this.secret = secret;
61      }
62  
63      public int getLength() {
64          return length;
65      }
66  
67      public void setLength(int length) {
68          this.length = length;
69      }
70  
71      public int getOffset() {
72          return offset;
73      }
74  
75      public void setOffset(int offset) {
76          this.offset = offset;
77      }
78  
79      public String getNonce() {
80          return nonce;
81      }
82  
83      public String getName() {
84          return id;
85      }
86  
87      public void setNonce(String nonce) {
88          this.nonce = nonce;
89      }
90  
91      public String getBasetokenId() {
92          return basetokenId;
93      }
94  
95      public void setBasetokenId(String basetokenId) {
96          this.basetokenId = basetokenId;
97      }
98  
99      public String getAlgorithm() {
100         return algorithm;
101     }
102 
103     public void setAlgorithm(String algorithm) {
104         this.algorithm = algorithm;
105     }
106 
107 
108 }