static byte[] GetKeyBytesFromProtectedKey( ProtectedKey protectedKey ) { if ( protectedKey == null ) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull( "protectedKey" ); } return protectedKey.GetKeyBytes(); }
static byte[] GetKeyBytesFromProtectedKey(ProtectedKey protectedKey) { if (protectedKey == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("protectedKey"); } return(protectedKey.GetKeyBytes()); }
public Entropy(ProtectedKey protectedKey) : base(protectedKey.GetKeyBytes(), protectedKey.WrappingCredentials) { }
public Entropy (ProtectedKey protectedKey) : base (protectedKey.GetKeyBytes (), protectedKey.WrappingCredentials) { }
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); } }