internal override bool TryExportKey( ReadOnlySpan <byte> key, KeyBlobFormat format, Span <byte> blob, out int blobSize) { return(format switch { KeyBlobFormat.RawSymmetricKey => RawKeyFormatter.TryExport(key, blob, out blobSize), KeyBlobFormat.NSecSymmetricKey => NSecKeyFormatter.TryExport(NSecBlobHeader, KeySize, MacSize, key, blob, out blobSize), _ => throw Error.Argument_FormatNotSupported(nameof(format), format.ToString()), });
internal override bool TryExportKey( SecureMemoryHandle keyHandle, KeyBlobFormat format, Span <byte> blob, out int blobSize) { switch (format) { case KeyBlobFormat.RawSymmetricKey: return(s_rawKeyFormatter.TryExport(keyHandle, blob, out blobSize)); case KeyBlobFormat.NSecSymmetricKey: return(s_nsecKeyFormatter.TryExport(keyHandle, blob, out blobSize)); default: throw Error.Argument_FormatNotSupported(nameof(format), format.ToString()); } }
internal override bool TryExportKey( ReadOnlySpan <byte> key, KeyBlobFormat format, Span <byte> blob, out int blobSize) { switch (format) { case KeyBlobFormat.RawSymmetricKey: return(RawKeyFormatter.TryExport(key, blob, out blobSize)); case KeyBlobFormat.NSecSymmetricKey: return(NSecKeyFormatter.TryExport(NSecBlobHeader, KeySize, MacSize, key, blob, out blobSize)); default: throw Error.Argument_FormatNotSupported(nameof(format), format.ToString()); } }