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.ws.security;
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   * @author Ruchith Fernando (ruchith.fernando@gmail.com)
31   */
32  public class WSDerivedKeyTokenPrincipal implements Principal {
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 byte[] secret;
42      
43      public String getLabel() {
44          return label;
45      }
46  
47      public void setLabel(String label) {
48          this.label = label;
49      }
50      
51      public byte[] getSecret() {
52          return secret;
53      }
54      
55      public void setSecret(byte[] secret) {
56          this.secret = secret;
57      }
58  
59      public int getLength() {
60          return length;
61      }
62  
63      public void setLength(int length) {
64          this.length = length;
65      }
66  
67      public int getOffset() {
68          return offset;
69      }
70  
71      public void setOffset(int offset) {
72          this.offset = offset;
73      }
74  
75      public String getNonce() {
76          return nonce;
77      }
78  
79      public WSDerivedKeyTokenPrincipal(String id) {
80          this.id = id;
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 }