View Javadoc
1   /*
2    * Copyright 2024 Michael Osipov
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package net.sf.michaelo.tomcat.pac;
17  
18  import net.sf.michaelo.tomcat.realm.Sid;
19  
20  /**
21   * A class representing the <a href=
22   * "https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-pac/311aab27-ebdf-47f7-b939-13dc99b15341">{@code KERB_SID_AND_ATTRIBUTES}</a>
23   * structure from MS-PAC.
24   */
25  public class KerbSidAndAttributes {
26  
27  	private final Sid sid;
28  	private final long attributes;
29  
30  	public KerbSidAndAttributes(Sid sid, long attributes) {
31  		this.sid = sid;
32  		this.attributes = attributes;
33  	}
34  
35  	public Sid getSid() {
36  		return sid;
37  	}
38  
39  	public long getAttributes() {
40  		return attributes;
41  	}
42  
43  	@Override
44  	public String toString() {
45  		return String.format("KerbSidAndAttributes[sid=%s, attributes=0x%08X]", sid, attributes);
46  	}
47  
48  }