Instance Methodswift-crypto 3.12.2_CryptoExtras
maximumEncryptSize(with:)
Return the maximum amount of data in bytes this key can encrypt in a single operation when using the specified padding mode.
- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
func maximumEncryptSize(with padding: _RSA.Encryption.Padding) -> Int
Common values:
Key size | Padding | Max length |
---|---|---|
2048 | PKCS-OAEP | 214 bytes |
3072 | PKCS-OAEP | 342 bytes |
4096 | PKCS-OAEP | 470 bytes |