sign (method)
Signs a buffer.
Syntax
- (NSData*)sign:(NSData*)buffer :(BOOL)detached;
public func sign(_ buffer: Data, _ detached: Bool) throws -> Data
Remarks
Use this method to sign a byte array and get the protected message in another byte array. Set the Detached parameter to false to create an enveloped/enveloping, rather than detached signature.Please note that certain signature algorithms/kinds only support detached signing.
Specify the signing key in Key property before commencing the signing.
Please note that the key assigned must have a private key part.