コード例 #1
0
        static byte[] GetKeyBytesFromProtectedKey( ProtectedKey protectedKey )
        {
            if ( protectedKey == null )
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull( "protectedKey" );
            }

            return protectedKey.GetKeyBytes();
        }
コード例 #2
0
ファイル: Entropy.cs プロジェクト: dox0/DotNet471RS3
        static byte[] GetKeyBytesFromProtectedKey(ProtectedKey protectedKey)
        {
            if (protectedKey == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("protectedKey");
            }

            return(protectedKey.GetKeyBytes());
        }
コード例 #3
0
ファイル: Entropy.cs プロジェクト: sampsonye/myMono
 public Entropy(ProtectedKey protectedKey) : base(protectedKey.GetKeyBytes(), protectedKey.WrappingCredentials)
 {
 }
コード例 #4
0
ファイル: Entropy.cs プロジェクト: nlhepler/mono
		public Entropy (ProtectedKey protectedKey) : base (protectedKey.GetKeyBytes (), protectedKey.WrappingCredentials)
		{ }
コード例 #5
0
        public static void WriteProtectedKey(XmlWriter writer, ProtectedKey protectedKey, WSTrustSerializationContext context, WSTrustConstantsAdapter trustConstants)
        {
            if (writer == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("writer");
            }

            if (protectedKey == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("protectedKey");
            }

            if (trustConstants == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("trustConstants");
            }

            if (protectedKey.WrappingCredentials != null)
            {
                byte[] encryptedKey = protectedKey.WrappingCredentials.SecurityKey.EncryptKey(protectedKey.WrappingCredentials.Algorithm, protectedKey.GetKeyBytes());
                EncryptedKeyIdentifierClause clause = new EncryptedKeyIdentifierClause(encryptedKey, protectedKey.WrappingCredentials.Algorithm, protectedKey.WrappingCredentials.SecurityKeyIdentifier);
                context.SecurityTokenHandlers.WriteKeyIdentifierClause(writer, clause);
            }
            else
            {
                BinarySecretSecurityToken entropyToken = new BinarySecretSecurityToken(protectedKey.GetKeyBytes());
                WriteBinarySecretSecurityToken(writer, entropyToken, trustConstants);
            }
        }