directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: rev 53872 - incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components
Date Wed, 06 Oct 2004 16:06:15 GMT
Author: erodriguez
Date: Wed Oct  6 09:06:14 2004
New Revision: 53872

Added:
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncApRepPart.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncAsRepPart.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncKdcRepPart.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncKrbCredPart.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncKrbPrivPart.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncTgsRepPart.java
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncTicketPart.java
Log:
kerberos encrypted message parts

Added: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncApRepPart.java
==============================================================================
--- (empty file)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncApRepPart.java
Wed Oct  6 09:06:14 2004
@@ -0,0 +1,51 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.kerberos.messages.components;
+
+import org.apache.kerberos.messages.value.*;
+
+/**
+ * Encrypted part of the application response
+ */
+public class EncApRepPart {
+
+	private KerberosTime  _clientTime;
+	private int           _cusec;
+	private EncryptionKey _subjectKey; //optional
+	private Integer       _sequenceNumber; //optional
+
+	public EncApRepPart(KerberosTime ctime, int cusec, EncryptionKey subKey, Integer seqNumber)
{
+		_clientTime = ctime;
+		_cusec = cusec;
+		_subjectKey = subKey;
+		_sequenceNumber = seqNumber;
+	}
+	
+	public KerberosTime getClientTime() {
+		return _clientTime;
+	}
+	public int getCusec() {
+		return _cusec;
+	}
+	public Integer getSequenceNumber() {
+		return _sequenceNumber;
+	}
+	public EncryptionKey getSubjectKey() {
+		return _subjectKey;
+	}
+}
+

Added: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncAsRepPart.java
==============================================================================
--- (empty file)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncAsRepPart.java
Wed Oct  6 09:06:14 2004
@@ -0,0 +1,39 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.kerberos.messages.components;
+
+import org.apache.kerberos.messages.value.*;
+
+/**
+ * Encrypted part of the authentication service response
+ */
+public class EncAsRepPart extends EncKdcRepPart {
+
+	/**
+	 * Class constructor
+	 */
+	public EncAsRepPart(EncryptionKey key, LastRequest lastReq, int nonce,
+			KerberosTime keyExpiration, TicketFlags flags, KerberosTime authTime,
+			KerberosTime startTime, KerberosTime endTime, KerberosTime renewTill,
+			Realm srealm, PrincipalName sname, HostAddresses caddr) {
+		
+		super(key, lastReq, nonce, keyExpiration, flags, authTime,
+				startTime, endTime, renewTill, srealm, sname, caddr,
+				MessageComponentType.KRB_ENC_AS_REP_PART);
+	}
+}
+

Added: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncKdcRepPart.java
==============================================================================
--- (empty file)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncKdcRepPart.java
Wed Oct  6 09:06:14 2004
@@ -0,0 +1,146 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.kerberos.messages.components;
+
+import org.apache.kerberos.messages.value.*;
+
+/**
+ * Base class for encrypted parts of KDC responses
+ */
+public class EncKdcRepPart {
+
+	private EncryptionKey _key;
+	private LastRequest   _lastRequest;
+	private int           _nonce;
+	private KerberosTime  _keyExpiration;   //optional
+	private TicketFlags   _flags = new TicketFlags();
+	private KerberosTime  _authTime;
+	private KerberosTime  _startTime;       //optional
+	private KerberosTime  _endTime;
+	private KerberosTime  _renewTill;       //optional
+	private Realm         _serverRealm;
+	private PrincipalName _serverName;
+	private HostAddresses _clientAddresses; //optional
+	private MessageComponentType _componentType;
+
+	/**
+	 * Class constructors
+	 */
+	public EncKdcRepPart() {
+		// built up by setter during reply generation
+	}
+	
+	public EncKdcRepPart(EncryptionKey key, LastRequest lastReq, int nonce,
+			KerberosTime keyExpiration, TicketFlags flags, KerberosTime authtime,
+			KerberosTime starttime, KerberosTime endtime, KerberosTime renewTill, Realm srealm,
+			PrincipalName sname, HostAddresses caddr, MessageComponentType componentType) {
+		
+		_key = key;
+		_lastRequest = lastReq;
+		_nonce = nonce;
+		_keyExpiration = keyExpiration;
+		_flags = flags;
+		_authTime = authtime;
+		_startTime = starttime;
+		_endTime = endtime;
+		_renewTill = renewTill;
+		_serverRealm = srealm;
+		_serverName = sname;
+		_clientAddresses = caddr;
+		_componentType = componentType;
+	}
+	
+	// getters
+	public KerberosTime getAuthTime() {
+		return _authTime;
+	}
+	public HostAddresses getClientAddresses() {
+		return _clientAddresses;
+	}
+	public KerberosTime getEndTime() {
+		return _endTime;
+	}
+	public TicketFlags getFlags() {
+		return _flags;
+	}
+	public EncryptionKey getKey() {
+		return _key;
+	}
+	public KerberosTime getKeyExpiration() {
+		return _keyExpiration;
+	}
+	public LastRequest getLastRequest() {
+		return _lastRequest;
+	}
+	public int getNonce() {
+		return _nonce;
+	}
+	public KerberosTime getRenewTill() {
+		return _renewTill;
+	}
+	public PrincipalName getServerName() {
+		return _serverName;
+	}
+	public Realm getServerRealm() {
+		return _serverRealm;
+	}
+	public KerberosTime getStartTime() {
+		return _startTime;
+	}
+	public MessageComponentType getComponentType() {
+		return _componentType;
+	}
+	
+	// setters
+	public void setAuthTime(KerberosTime time) {
+		_authTime = time;
+	}
+	public void setClientAddresses(HostAddresses addresses) {
+		_clientAddresses = addresses;
+	}
+	public void setEndTime(KerberosTime time) {
+		_endTime = time;
+	}
+	public void setFlags(TicketFlags flags) {
+		_flags = flags;
+	}
+	public void setKey(EncryptionKey key) {
+		_key = key;
+	}
+	public void setKeyExpiration(KerberosTime expiration) {
+		_keyExpiration = expiration;
+	}
+	public void setLastRequest(LastRequest request) {
+		_lastRequest = request;
+	}
+	public void setNonce(int nonce) {
+		_nonce = nonce;
+	}
+	public void setRenewTill(KerberosTime till) {
+		_renewTill = till;
+	}
+	public void setServerName(PrincipalName name) {
+		_serverName = name;
+	}
+	public void setServerRealm(Realm realm) {
+		_serverRealm = realm;
+	}
+	public void setStartTime(KerberosTime time) {
+		_startTime = time;
+	}
+}
+

Added: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncKrbCredPart.java
==============================================================================
--- (empty file)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncKrbCredPart.java
Wed Oct  6 09:06:14 2004
@@ -0,0 +1,48 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.kerberos.messages.components;
+
+import org.apache.kerberos.messages.value.*;
+
+/**
+ * Encrypted part of credential message types
+ */
+public class EncKrbCredPart {
+
+	public KrbCredInfo[] _ticketInfo;
+	public Integer       _nonce;     //optional
+	public KerberosTime  _timeStamp; //optional
+	public Integer       _usec;      //optional
+	public HostAddress   _sAddress;  //optional
+	public HostAddresses _rAddress;  //optional
+
+	/**
+	 * Class constructor
+	 */
+	public EncKrbCredPart(KrbCredInfo[] ticketInfo, KerberosTime timeStamp,
+			Integer usec, Integer nonce, HostAddress sAddress,
+			HostAddresses rAddress) {
+		
+		_ticketInfo = ticketInfo;
+		_nonce      = nonce;
+		_timeStamp  = timeStamp;
+		_usec       = usec;
+		_sAddress   = sAddress;
+		_rAddress   = rAddress;
+	}
+}
+

Added: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncKrbPrivPart.java
==============================================================================
--- (empty file)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncKrbPrivPart.java
Wed Oct  6 09:06:14 2004
@@ -0,0 +1,66 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.kerberos.messages.components;
+
+import org.apache.kerberos.messages.value.*;
+
+/**
+ * Encrypted part of private message types
+ */
+public class EncKrbPrivPart {
+
+	private byte[]       _userData;
+	private KerberosTime _timestamp; //optional
+	private Integer      _usec;      //optional
+	private Integer      _seqNumber; //optional
+	private HostAddress  _sAddress;  //optional
+	private HostAddress  _rAddress;  //optional
+
+	/**
+	 * Class constructor
+	 */
+	public EncKrbPrivPart(byte[] userData, KerberosTime timestamp, Integer usec,
+			Integer seqNumber, HostAddress sAddress, HostAddress rAddress) {
+		
+		_userData  = userData;
+		_timestamp = timestamp;
+		_usec      = usec;
+		_seqNumber = seqNumber;
+		_sAddress  = sAddress;
+		_rAddress  = rAddress;
+	}
+
+	public HostAddress getRAddress() {
+		return _rAddress;
+	}
+	public HostAddress getSAddress() {
+		return _sAddress;
+	}
+	public Integer getSeqNumber() {
+		return _seqNumber;
+	}
+	public KerberosTime getTimestamp() {
+		return _timestamp;
+	}
+	public Integer getUsec() {
+		return _usec;
+	}
+	public byte[] getUserData() {
+		return _userData;
+	}
+}
+

Added: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncTgsRepPart.java
==============================================================================
--- (empty file)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncTgsRepPart.java
Wed Oct  6 09:06:14 2004
@@ -0,0 +1,39 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.kerberos.messages.components;
+
+import org.apache.kerberos.messages.value.*;
+
+/**
+ * Encrypted part of TGS responses
+ */
+public class EncTgsRepPart extends EncKdcRepPart {
+
+	/**
+	 * Class constructor
+	 */
+	public EncTgsRepPart(EncryptionKey key, LastRequest lastReq, int nonce,
+			KerberosTime keyExpiration, TicketFlags flags, KerberosTime authtime,
+			KerberosTime starttime, KerberosTime endtime, KerberosTime renewTill,
+			Realm srealm, PrincipalName sname, HostAddresses caddr) {
+		
+		super(key, lastReq, nonce, keyExpiration, flags, authtime,
+				starttime, endtime, renewTill, srealm, sname, caddr,
+				MessageComponentType.KRB_ENC_TGS_REP_PART);
+	}
+}
+

Added: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncTicketPart.java
==============================================================================
--- (empty file)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/components/EncTicketPart.java
Wed Oct  6 09:06:14 2004
@@ -0,0 +1,129 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.kerberos.messages.components;
+
+import org.apache.kerberos.messages.value.*;
+
+/**
+ * Encrypted part of Tickets
+ */
+public class EncTicketPart {
+
+	private TicketFlags       _flags = new TicketFlags();
+	private EncryptionKey     _sessionKey;
+	private Realm             _clientRealm;
+	private PrincipalName     _clientName;
+	private TransitedEncoding _transitedEncoding;
+	private KerberosTime      _authtime;
+	private KerberosTime      _startTime;         //optional
+	private KerberosTime      _endTime;
+	private KerberosTime      _renewTill;         //optional
+	private HostAddresses     _clientAddresses;   //optional
+	private AuthorizationData _authorizationData; //optional
+	
+	public EncTicketPart() {
+		// Used to create new tickets
+	}
+
+	public EncTicketPart(TicketFlags flags, EncryptionKey key, Realm crealm, PrincipalName cname,
+			TransitedEncoding transited, KerberosTime authtime, KerberosTime starttime,
+			KerberosTime endtime, KerberosTime renewTill, HostAddresses caddr,
+			AuthorizationData authorizationData) {
+		
+		_flags             = flags;
+		_sessionKey        = key;
+		_clientRealm       = crealm;
+		_clientName        = cname;
+		_transitedEncoding = transited;
+		_authtime          = authtime;
+		_startTime         = starttime;
+		_endTime           = endtime;
+		_renewTill         = renewTill;
+		_clientAddresses   = caddr;
+		_authorizationData = authorizationData;
+	}
+
+	public AuthorizationData getAuthorizationData() {
+		return _authorizationData;
+	}
+	public KerberosTime getAuthtime() {
+		return _authtime;
+	}
+	public HostAddresses getClientAddresses() {
+		return _clientAddresses;
+	}
+	public PrincipalName getClientName() {
+		return _clientName;
+	}
+	public Realm getClientRealm() {
+		return _clientRealm;
+	}
+	public KerberosTime getEndTime() {
+		return _endTime;
+	}
+	public TicketFlags getFlags() {
+		return _flags;
+	}
+	public EncryptionKey getSessionKey() {
+		return _sessionKey;
+	}
+	public KerberosTime getRenewTill() {
+		return _renewTill;
+	}
+	public KerberosTime getStartTime() {
+		return _startTime;
+	}
+	public TransitedEncoding getTransitedEncoding() {
+		return _transitedEncoding;
+	}
+	
+	
+	public void setAuthorizationData(AuthorizationData data) {
+		_authorizationData = data;
+	}
+	public void setAuthtime(KerberosTime authtime) {
+		_authtime = authtime;
+	}
+	public void setClientAddresses(HostAddresses addresses) {
+		_clientAddresses = addresses;
+	}
+	public void setClientName(PrincipalName name) {
+		_clientName = name;
+	}
+	public void setClientRealm(Realm realm) {
+		_clientRealm = realm;
+	}
+	public void setEndTime(KerberosTime time) {
+		_endTime = time;
+	}
+	public void setFlags(TicketFlags flags) {
+		_flags = flags;
+	}
+	public void setRenewTill(KerberosTime till) {
+		_renewTill = till;
+	}
+	public void setSessionKey(EncryptionKey key) {
+		_sessionKey = key;
+	}
+	public void setStartTime(KerberosTime time) {
+		_startTime = time;
+	}
+	public void setTransitedEncoding(TransitedEncoding encoding) {
+		_transitedEncoding = encoding;
+	}
+}
+

Mime
View raw message