Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
//
// BasicSecurityProfileVersion.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace System.ServiceModel.Security
{
public abstract class BasicSecurityProfileVersion
{
static BasicSecurityProfileVersion impl = new BasicSecurityProfileVersionImpl ();
public static BasicSecurityProfileVersion BasicSecurityProfile10 {
get { return impl; }
}
private BasicSecurityProfileVersion ()
{
}
class BasicSecurityProfileVersionImpl : BasicSecurityProfileVersion
{
}
}
}

View File

@@ -0,0 +1,87 @@
//
// BinarySecretKeyIdentifierClause.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.Xml;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
namespace System.ServiceModel.Security
{
public class BinarySecretKeyIdentifierClause : BinaryKeyIdentifierClause
{
public BinarySecretKeyIdentifierClause (byte [] key)
: this (key, true)
{
}
[MonoTODO ("ClauseType")]
public BinarySecretKeyIdentifierClause (byte [] key, bool cloneBuffer)
: base ("", key, cloneBuffer)
{
}
[MonoTODO ("ClauseType")]
public BinarySecretKeyIdentifierClause (byte [] key, bool cloneBuffer, byte [] derivationNonce, int derivationLength)
: base ("", key, cloneBuffer, derivationNonce, derivationLength)
{
}
public override bool CanCreateKey {
get { return true; }
}
public byte [] GetKeyBytes ()
{
return GetBuffer ();
}
public override SecurityKey CreateKey ()
{
return new InMemorySymmetricSecurityKey (GetRawBuffer (), true);
}
public override bool Matches (SecurityKeyIdentifierClause clause)
{
if (clause == null)
throw new ArgumentNullException ("clause");
BinarySecretKeyIdentifierClause other =
clause as BinarySecretKeyIdentifierClause;
if (other == null)
return false;
byte [] b1 = GetRawBuffer ();
byte [] b2 = other.GetRawBuffer ();
if (b1.Length != b2.Length)
return false;
for (int i = 0; i < b1.Length; i++)
if (b1 [i] != b2 [i])
return false;
return true;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,212 @@
//
// ChannelProtectionRequirements.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2005-2006 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Net.Security;
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.Xml;
namespace System.ServiceModel.Security
{
// Represents sp:SignedParts and sp:EncryptedParts in
// sp:SupportingTokens/ws:Policy/.
public class ChannelProtectionRequirements
{
bool is_readonly;
ScopedMessagePartSpecification in_enc, in_sign, out_enc, out_sign;
public ChannelProtectionRequirements ()
{
in_enc = new ScopedMessagePartSpecification ();
out_enc = new ScopedMessagePartSpecification ();
in_sign = new ScopedMessagePartSpecification ();
out_sign = new ScopedMessagePartSpecification ();
}
public ChannelProtectionRequirements (
ChannelProtectionRequirements other)
{
if (other == null)
throw new ArgumentNullException ("other");
in_enc = new ScopedMessagePartSpecification (other.in_enc);
out_enc = new ScopedMessagePartSpecification (other.out_enc);
in_sign = new ScopedMessagePartSpecification (other.in_sign);
out_sign = new ScopedMessagePartSpecification (other.out_sign);
}
public bool IsReadOnly {
get { return is_readonly; }
}
public ScopedMessagePartSpecification IncomingEncryptionParts {
get { return in_enc; }
}
public ScopedMessagePartSpecification IncomingSignatureParts {
get { return in_sign; }
}
public ScopedMessagePartSpecification OutgoingEncryptionParts {
get { return out_enc; }
}
public ScopedMessagePartSpecification OutgoingSignatureParts {
get { return out_sign; }
}
public void Add (
ChannelProtectionRequirements protectionRequirements)
{
Add (protectionRequirements, false);
}
public void Add (
ChannelProtectionRequirements protectionRequirements,
bool channelScopeOnly)
{
if (is_readonly)
throw new InvalidOperationException ("This ChannelProtectionRequirements is read-only.");
AddScopedParts (
protectionRequirements.IncomingEncryptionParts,
IncomingEncryptionParts,
channelScopeOnly);
AddScopedParts (
protectionRequirements.IncomingSignatureParts,
IncomingSignatureParts,
channelScopeOnly);
AddScopedParts (
protectionRequirements.OutgoingEncryptionParts,
OutgoingEncryptionParts,
channelScopeOnly);
AddScopedParts (
protectionRequirements.OutgoingSignatureParts,
OutgoingSignatureParts,
channelScopeOnly);
}
void AddScopedParts (ScopedMessagePartSpecification src, ScopedMessagePartSpecification dst, bool channelOnly)
{
dst.AddParts (src.ChannelParts);
if (channelOnly)
return;
foreach (string a in src.Actions) {
MessagePartSpecification m;
src.TryGetParts (a, out m);
src.AddParts (m);
}
}
public ChannelProtectionRequirements CreateInverse ()
{
ChannelProtectionRequirements r =
new ChannelProtectionRequirements ();
AddScopedParts (in_enc, r.out_enc, false);
AddScopedParts (in_sign, r.out_sign, false);
AddScopedParts (out_enc, r.in_enc, false);
AddScopedParts (out_sign, r.in_sign, false);
return r;
}
public void MakeReadOnly ()
{
is_readonly = true;
in_enc.MakeReadOnly ();
in_sign.MakeReadOnly ();
out_enc.MakeReadOnly ();
out_sign.MakeReadOnly ();
}
internal static ChannelProtectionRequirements CreateFromContract (ContractDescription cd)
{
ChannelProtectionRequirements cp =
new ChannelProtectionRequirements ();
List<XmlQualifiedName> enc = new List<XmlQualifiedName> ();
List<XmlQualifiedName> sig = new List<XmlQualifiedName> ();
if (cd.HasProtectionLevel) {
switch (cd.ProtectionLevel) {
case ProtectionLevel.EncryptAndSign:
cp.IncomingEncryptionParts.ChannelParts.IsBodyIncluded = true;
cp.OutgoingEncryptionParts.ChannelParts.IsBodyIncluded = true;
goto case ProtectionLevel.Sign;
case ProtectionLevel.Sign:
cp.IncomingSignatureParts.ChannelParts.IsBodyIncluded = true;
cp.OutgoingSignatureParts.ChannelParts.IsBodyIncluded = true;
break;
}
}
foreach (OperationDescription od in cd.Operations) {
foreach (MessageDescription md in od.Messages) {
enc.Clear ();
sig.Clear ();
ProtectionLevel mplv =
md.HasProtectionLevel ? md.ProtectionLevel :
od.HasProtectionLevel ? od.ProtectionLevel :
ProtectionLevel.EncryptAndSign; // default
foreach (MessageHeaderDescription hd in md.Headers)
AddPartProtectionRequirements (enc, sig, hd, cp);
ScopedMessagePartSpecification spec;
bool includeBodyEnc = mplv == ProtectionLevel.EncryptAndSign;
bool includeBodySig = mplv != ProtectionLevel.None;
// enc
spec = md.Direction == MessageDirection.Input ?
cp.IncomingEncryptionParts :
cp.OutgoingEncryptionParts;
spec.AddParts (new MessagePartSpecification (includeBodyEnc, enc.ToArray ()), md.Action);
// sig
spec = md.Direction == MessageDirection.Input ?
cp.IncomingSignatureParts :
cp.OutgoingSignatureParts;
spec.AddParts (new MessagePartSpecification (includeBodySig, sig.ToArray ()), md.Action);
}
}
return cp;
}
static void AddPartProtectionRequirements (List<XmlQualifiedName> enc,
List<XmlQualifiedName> sig,
MessageHeaderDescription pd,
ChannelProtectionRequirements cp)
{
if (!pd.HasProtectionLevel)
return; // no specific part indication
switch (pd.ProtectionLevel) {
case ProtectionLevel.EncryptAndSign:
enc.Add (new XmlQualifiedName (pd.Name, pd.Namespace));
goto case ProtectionLevel.Sign;
case ProtectionLevel.Sign:
sig.Add (new XmlQualifiedName (pd.Name, pd.Namespace));
break;
}
}
}
}

View File

@@ -0,0 +1,78 @@
//
// DataProtectionSecurityStateEncoder.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006-2007 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Security.Cryptography;
namespace System.ServiceModel.Security
{
public class DataProtectionSecurityStateEncoder : SecurityStateEncoder
{
public DataProtectionSecurityStateEncoder ()
: this (true)
{
}
public DataProtectionSecurityStateEncoder (bool useCurrentUserProtectionScope)
{
user = useCurrentUserProtectionScope;
}
public DataProtectionSecurityStateEncoder (bool useCurrentUserProtectionScope, byte [] entropy)
{
user = useCurrentUserProtectionScope;
this.entropy = entropy;
}
bool user;
byte [] entropy;
public bool UseCurrentUserProtectionScope {
get { return user; }
}
public byte [] GetEntropy ()
{
return entropy == null ? null : (byte []) entropy.Clone ();
}
[MonoTODO]
public override string ToString ()
{
return base.ToString ();
}
protected internal override byte [] DecodeSecurityState (byte [] data)
{
return ProtectedData.Unprotect (data, entropy, DataProtectionScope.CurrentUser);
}
protected internal override byte [] EncodeSecurityState (byte [] data)
{
return ProtectedData.Protect (data, entropy, DataProtectionScope.CurrentUser);
}
}
}

View File

@@ -0,0 +1,65 @@
//
// ExpiredSecurityTokenException.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.IdentityModel.Tokens;
using System.Runtime.Serialization;
using System.ServiceModel.Channels;
namespace System.ServiceModel.Security
{
[Serializable]
public class ExpiredSecurityTokenException : MessageSecurityException
{
public ExpiredSecurityTokenException ()
: this ("The security token is expired.")
{
}
public ExpiredSecurityTokenException (string message)
: base (message)
{
}
public ExpiredSecurityTokenException (string message,
Exception innerException)
: base (message, innerException)
{
}
protected ExpiredSecurityTokenException (SerializationInfo info,
StreamingContext context)
: base (info, context)
{
}
public override void GetObjectData (SerializationInfo info, StreamingContext ctx)
{
base.GetObjectData (info, ctx);
}
}
}

View File

@@ -0,0 +1,59 @@
//
// HttpDigestClientCredential.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Net;
using System.Security.Principal;
using System.ServiceModel.Security;
namespace System.ServiceModel.Security
{
public sealed class HttpDigestClientCredential
{
internal HttpDigestClientCredential ()
{
}
NetworkCredential credential = new NetworkCredential ();
TokenImpersonationLevel level;
internal HttpDigestClientCredential Clone ()
{
return (HttpDigestClientCredential) MemberwiseClone ();
}
public NetworkCredential ClientCredential {
get { return credential; }
set { credential = value; }
}
public TokenImpersonationLevel AllowedImpersonationLevel {
get { return level; }
set { level = value; }
}
}
}

View File

@@ -0,0 +1,37 @@
//
// IEndpointIdentityProvider.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.IdentityModel.Selectors;
using System.ServiceModel;
namespace System.ServiceModel.Security
{
public interface IEndpointIdentityProvider
{
EndpointIdentity GetIdentityOfSelf (SecurityTokenRequirement tokenRequirement);
}
}

View File

@@ -0,0 +1,39 @@
//
// ISecureConversationSession.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.ServiceModel;
using System.Xml;
namespace System.ServiceModel.Security
{
public interface ISecureConversationSession : ISecuritySession
{
bool TryReadSessionTokenIdentifier (XmlReader reader);
void WriteSessionTokenIdentifier (XmlDictionaryWriter writer);
}
}

View File

@@ -0,0 +1,37 @@
//
// ISecuritySession.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace System.ServiceModel.Security
{
public interface ISecuritySession : ISession
{
EndpointIdentity RemoteIdentity { get; }
}
}

View File

@@ -0,0 +1,73 @@
//
// IdentityVerifier.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.ServiceModel;
namespace System.ServiceModel.Security
{
[MonoTODO]
public abstract class IdentityVerifier
{
[MonoTODO]
public static IdentityVerifier CreateDefault ()
{
return new DefaultIdentityVerifier ();
}
protected IdentityVerifier ()
{
}
public abstract bool CheckAccess (EndpointIdentity identity,
AuthorizationContext authContext);
public abstract bool TryGetIdentity (EndpointAddress reference,
out EndpointIdentity identity);
class DefaultIdentityVerifier : IdentityVerifier
{
public override bool CheckAccess (
EndpointIdentity identity,
AuthorizationContext authContext)
{
// FIXME: implement
throw new NotImplementedException ();
}
public override bool TryGetIdentity (
EndpointAddress reference,
out EndpointIdentity identity)
{
// FIXME: implement
throw new NotImplementedException ();
}
}
}
}

View File

@@ -0,0 +1,70 @@
//
// InfocardInteractiveChannelInitializer.cs
//
// Author: Atsushi Enomoto (atsushi@ximian.com)
//
// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
namespace System.ServiceModel.Security
{
[MonoTODO]
public class InfocardInteractiveChannelInitializer
: IInteractiveChannelInitializer
{
[MonoTODO]
public InfocardInteractiveChannelInitializer (
ClientCredentials credentials,
Binding binding)
{
this.binding = binding;
this.credentials = credentials;
}
Binding binding;
ClientCredentials credentials;
public Binding Binding {
get { return binding; }
}
[MonoTODO]
public IAsyncResult BeginDisplayInitializationUI (
IClientChannel channel,
AsyncCallback callback,
object state)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void EndDisplayInitializationUI (IAsyncResult result)
{
throw new NotImplementedException ();
}
}
}

View File

@@ -0,0 +1,103 @@
//
// IssuedTokenClientCredential.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2005 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.Net;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel;
using System.ServiceModel.Security.Tokens;
namespace System.ServiceModel.Security
{
[MonoTODO]
public sealed class IssuedTokenClientCredential
{
internal IssuedTokenClientCredential ()
{
}
bool cache = true;
Dictionary<Uri,KeyedByTypeCollection<IEndpointBehavior>> behaviors =
new Dictionary<Uri,KeyedByTypeCollection<IEndpointBehavior>> ();
SecurityKeyEntropyMode entropy = SecurityKeyEntropyMode.CombinedEntropy;
KeyedByTypeCollection<IEndpointBehavior> local_behaviors =
new KeyedByTypeCollection<IEndpointBehavior> ();
EndpointAddress local_issuer_address;
Binding local_issuer_binding;
TimeSpan max_cache_time = TimeSpan.MaxValue;
// FIXME: could be related to LocalClientSecuritysettings.CookieRenewalThresholdPercentage ?
int renewal_threshold = 60;
internal IssuedTokenClientCredential Clone ()
{
var ret = (IssuedTokenClientCredential) MemberwiseClone ();
ret.local_behaviors = new KeyedByTypeCollection<IEndpointBehavior> (local_behaviors);
ret.behaviors = new Dictionary<Uri,KeyedByTypeCollection<IEndpointBehavior>> (behaviors);
return ret;
}
public bool CacheIssuedTokens {
get { return cache; }
set { cache = value; }
}
public int IssuedTokenRenewalThresholdPercentage {
get { return renewal_threshold; }
set { renewal_threshold = value; }
}
public Dictionary<Uri,KeyedByTypeCollection<IEndpointBehavior>> IssuerChannelBehaviors {
get { return behaviors; }
}
public SecurityKeyEntropyMode DefaultKeyEntropyMode {
get { return entropy; }
set { entropy = value; }
}
public KeyedByTypeCollection<IEndpointBehavior> LocalIssuerChannelBehaviors {
get { return local_behaviors; }
}
public EndpointAddress LocalIssuerAddress {
get { return local_issuer_address; }
set { local_issuer_address = value; }
}
public Binding LocalIssuerBinding {
get { return local_issuer_binding; }
set { local_issuer_binding = value; }
}
public TimeSpan MaxIssuedTokenCachingTime {
get { return max_cache_time; }
set { max_cache_time = value; }
}
}
}

View File

@@ -0,0 +1,111 @@
//
// IssuedTokenServiceCredential.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.IdentityModel.Selectors;
using System.IdentityModel.Tokens;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel;
using System.ServiceModel.Security.Tokens;
namespace System.ServiceModel.Security
{
[MonoTODO]
public class IssuedTokenServiceCredential
{
bool allow_untrusted_rsa_issuers;
X509CertificateValidationMode cert_verify_mode =
X509CertificateValidationMode.ChainTrust;
X509CertificateValidator custom_cert_validator;
List<X509Certificate2> known_certs = new List<X509Certificate2> ();
X509RevocationMode revocation_mode = X509RevocationMode.Online;
SamlSerializer saml_serializer;
StoreLocation store_location = StoreLocation.LocalMachine;
internal IssuedTokenServiceCredential ()
{
AllowedAudienceUris = new List<string> ();
}
internal IssuedTokenServiceCredential Clone ()
{
var ret = (IssuedTokenServiceCredential) MemberwiseClone ();
ret.known_certs = new List<X509Certificate2> (known_certs);
return ret;
}
[MonoTODO]
public IList<string> AllowedAudienceUris { get; private set; }
[MonoTODO]
public bool AllowUntrustedRsaIssuers {
get { return allow_untrusted_rsa_issuers; }
set { allow_untrusted_rsa_issuers = value; }
}
[MonoTODO]
public AudienceUriMode AudienceUriMode { get; set; }
[MonoTODO]
public X509CertificateValidationMode CertificateValidationMode {
get { return cert_verify_mode; }
set { cert_verify_mode = value; }
}
[MonoTODO]
public X509CertificateValidator CustomCertificateValidator {
get { return custom_cert_validator; }
set { custom_cert_validator = value; }
}
[MonoTODO]
public IList<X509Certificate2> KnownCertificates {
get { return known_certs; }
}
[MonoTODO]
public X509RevocationMode RevocationMode {
get { return revocation_mode; }
set { revocation_mode = value; }
}
[MonoTODO]
public SamlSerializer SamlSerializer {
get { return saml_serializer; }
set { saml_serializer = value; }
}
[MonoTODO]
public StoreLocation TrustedStoreLocation {
get { return store_location; }
set { store_location = value; }
}
}
}

View File

@@ -0,0 +1,37 @@
//
// SecurityKeyEntropyMode.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2005 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace System.ServiceModel.Security
{
public enum SecurityKeyEntropyMode
{
ClientEntropy,
ServerEntropy,
CombinedEntropy,
}
}

View File

@@ -0,0 +1,69 @@
//
// KeyNameIdentifierClause.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.Xml;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
namespace System.ServiceModel.Security
{
public class KeyNameIdentifierClause : SecurityKeyIdentifierClause
{
public KeyNameIdentifierClause (string keyName)
: base (null)
{
key_name = keyName;
}
string key_name;
public string KeyName {
get { return key_name; }
}
public override bool Matches (SecurityKeyIdentifierClause clause)
{
if (clause == null)
throw new ArgumentNullException ("clause");
KeyNameIdentifierClause knic =
clause as KeyNameIdentifierClause;
return knic != null && Matches (knic.KeyName);
}
public bool Matches (string keyName)
{
return key_name == keyName;
}
public override string ToString ()
{
return String.Concat ("KeyNameIdentifierClause(KeyName = '", KeyName, "')");
}
}
}

View File

@@ -0,0 +1,111 @@
//
// MessagePartSpecification.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ServiceModel;
using System.Xml;
namespace System.ServiceModel.Security
{
// Represents WS-SecurityPolicy SignedParts or EncryptedParts.
public class MessagePartSpecification
{
static XmlQualifiedName [] empty = new XmlQualifiedName [0];
static MessagePartSpecification no_parts =
new MessagePartSpecification ();
public static MessagePartSpecification NoParts {
get { return no_parts; }
}
public MessagePartSpecification ()
: this (empty)
{
}
public MessagePartSpecification (
bool isBodyIncluded)
: this (isBodyIncluded, empty)
{
}
public MessagePartSpecification (params XmlQualifiedName[] headerTypes)
: this (false, headerTypes)
{
}
public MessagePartSpecification (
bool isBodyIncluded,
params XmlQualifiedName[] headerTypes)
{
body = isBodyIncluded;
header_types = new List<XmlQualifiedName> (headerTypes);
}
bool body;
IList<XmlQualifiedName> header_types;
public ICollection<XmlQualifiedName> HeaderTypes {
get { return header_types; }
}
public bool IsBodyIncluded {
get { return body; }
set { body = value; }
}
public bool IsReadOnly {
get { return header_types.IsReadOnly; }
}
public void Clear ()
{
header_types.Clear ();
}
public void MakeReadOnly ()
{
if (!header_types.IsReadOnly)
header_types = new ReadOnlyCollection<XmlQualifiedName> (header_types);
}
public void Union (MessagePartSpecification other)
{
if (other == null)
throw new ArgumentNullException ("other");
if (header_types.IsReadOnly)
throw new InvalidOperationException ("This MessagePartSpecification is read-only.");
body |= other.body;
foreach (XmlQualifiedName q in other.header_types)
// Sigh. It could be much better here.
//if (!header_types.Contains (q))
header_types.Add (q);
}
}
}

View File

@@ -0,0 +1,37 @@
//
// MessageProtectionOrder.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2005 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace System.ServiceModel.Security
{
public enum MessageProtectionOrder
{
SignBeforeEncrypt,
SignBeforeEncryptAndEncryptSignature,
EncryptBeforeSign,
}
}

View File

@@ -0,0 +1,64 @@
//
// MessageSecurityException.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Runtime.Serialization;
using System.ServiceModel.Channels;
namespace System.ServiceModel.Security
{
[Serializable]
public class MessageSecurityException : CommunicationException
{
public MessageSecurityException ()
: this ("Message security exception has happened.")
{
}
public MessageSecurityException (string message)
: base (message)
{
}
public MessageSecurityException (string message,
Exception innerException)
: base (message, innerException)
{
}
protected MessageSecurityException (SerializationInfo info,
StreamingContext context)
: base (info, context)
{
}
public override void GetObjectData (SerializationInfo info, StreamingContext ctx)
{
base.GetObjectData (info, ctx);
}
}
}

View File

@@ -0,0 +1,84 @@
//
// PeerCredential.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006 Novell, Inc. http://www.novell.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Security.Cryptography.X509Certificates;
namespace System.ServiceModel.Security
{
public class PeerCredential
{
internal PeerCredential ()
{
}
X509Certificate2 cert;
string mesh_pwd;
X509PeerCertificateAuthentication cert_auth =
new X509PeerCertificateAuthentication ();
X509PeerCertificateAuthentication peer_auth =
new X509PeerCertificateAuthentication ();
internal PeerCredential Clone ()
{
return new PeerCredential () { cert = this.cert, cert_auth = this.cert_auth.Clone (), peer_auth = this.peer_auth.Clone () };
}
public X509Certificate2 Certificate {
get { return cert; }
set { cert = value; }
}
public string MeshPassword {
get { return mesh_pwd; }
set { mesh_pwd = value; }
}
public X509PeerCertificateAuthentication MessageSenderAuthentication {
get { return cert_auth; }
// huh, should there be a setter?
set { cert_auth = value; }
}
public X509PeerCertificateAuthentication PeerAuthentication {
get { return peer_auth; }
set { peer_auth = value; }
}
[MonoTODO]
public void SetCertificate (string subjectName, StoreLocation storeLocation, StoreName storeName)
{
throw new NotImplementedException ();
}
[MonoTODO]
public void SetCertificate (StoreLocation storeLocation, StoreName storeName, X509FindType findType, object findValue)
{
throw new NotImplementedException ();
}
}
}

Some files were not shown because too many files have changed in this diff Show More