Package org.robovm.apple.security
Class SecKey
- java.lang.Object
-
- org.robovm.rt.bro.NativeObject
-
- org.robovm.apple.corefoundation.CFType
-
- org.robovm.apple.security.SecKey
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class SecKey extends CFType
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SecKey.SecKeyPtr
-
Nested classes/interfaces inherited from class org.robovm.apple.corefoundation.CFType
CFType.AsListMarshaler, CFType.CFTypePtr, CFType.Marshaler, CFType.NoRetainMarshaler
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SecKey()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NSDictionary
copyAttributes()
NSData
copyExternalRepresentation(NSError error)
NSData
copyKeyExchangeResult(java.lang.String algorithm, SecKey publicKey, NSDictionary parameters, NSError error)
SecKey
copyPublicKey()
NSData
createDecryptedData(java.lang.String algorithm, NSData ciphertext, NSError error)
NSData
createEncryptedData(java.lang.String algorithm, NSData plaintext, NSError error)
static SecKey
createRandomKey(NSDictionary parameters, NSError error)
NSData
createSignature(java.lang.String algorithm, NSData dataToSign, NSError error)
static SecKey
createWithData(NSData keyData, NSDictionary attributes, NSError error)
byte[]
decrypt(SecPadding padding, byte[] cipherText)
protected OSStatus
decrypt0(SecPadding padding, long cipherText, long cipherTextLen, org.robovm.rt.bro.ptr.BytePtr plainText, org.robovm.rt.bro.ptr.MachineSizedUIntPtr plainTextLen)
byte[]
encrypt(SecPadding padding, byte[] plainText)
protected OSStatus
encrypt0(SecPadding padding, long plainText, long plainTextLen, org.robovm.rt.bro.ptr.BytePtr cipherText, org.robovm.rt.bro.ptr.MachineSizedUIntPtr cipherTextLen)
static void
generatePair(SecKeyParameters parameters, SecKey.SecKeyPtr publicKey, SecKey.SecKeyPtr privateKey)
static void
generatePair(SecKeyParameters parameters, org.robovm.objc.block.VoidBlock2<SecKey,SecKey> result)
protected static OSStatus
generatePair0(SecKeyParameters parameters, SecKey.SecKeyPtr publicKey, SecKey.SecKeyPtr privateKey)
long
getBlockSize()
static long
getClassTypeID()
boolean
isAlgorithmSupported(SecKeyOperationType operation, java.lang.String algorithm)
byte[]
rawSign(SecPadding padding, byte[] dataToSign)
protected OSStatus
rawSign0(SecPadding padding, long dataToSign, long dataToSignLen, org.robovm.rt.bro.ptr.BytePtr sig, org.robovm.rt.bro.ptr.MachineSizedUIntPtr sigLen)
void
rawVerify(SecPadding padding, byte[] signedData, byte[] sig)
protected OSStatus
rawVerify0(SecPadding padding, long signedData, long signedDataLen, long sig, long sigLen)
boolean
verifySignature(java.lang.String algorithm, NSData signedData, NSData signature, NSError error)
-
Methods inherited from class org.robovm.apple.corefoundation.CFType
autorelease, close, dispose, dispose, doDispose, equalsTo, finalize, getAllocator, getDescription, getRetainCount, getTypeID, getTypeIDDescription, hash, makeCollectable, release, release, retain, retain, show, toString
-
-
-
-
Method Detail
-
generatePair
public static void generatePair(SecKeyParameters parameters, SecKey.SecKeyPtr publicKey, SecKey.SecKeyPtr privateKey) throws OSStatusException
- Throws:
OSStatusException
- Since:
- Available in iOS 2.0 and later.
-
generatePair
public static void generatePair(SecKeyParameters parameters, org.robovm.objc.block.VoidBlock2<SecKey,SecKey> result) throws OSStatusException
- Throws:
OSStatusException
- Since:
- Available in iOS 2.0 and later.
-
rawSign
public byte[] rawSign(SecPadding padding, byte[] dataToSign) throws OSStatusException
- Throws:
OSStatusException
- Since:
- Available in iOS 2.0 and later.
-
rawVerify
public void rawVerify(SecPadding padding, byte[] signedData, byte[] sig) throws OSStatusException
- Throws:
OSStatusException
- Since:
- Available in iOS 2.0 and later.
-
encrypt
public byte[] encrypt(SecPadding padding, byte[] plainText) throws OSStatusException
- Throws:
OSStatusException
- Since:
- Available in iOS 2.0 and later.
-
decrypt
public byte[] decrypt(SecPadding padding, byte[] cipherText) throws OSStatusException
- Throws:
OSStatusException
- Since:
- Available in iOS 2.0 and later.
-
getClassTypeID
public static long getClassTypeID()
- Since:
- Available in iOS 2.0 and later.
-
generatePair0
protected static OSStatus generatePair0(SecKeyParameters parameters, SecKey.SecKeyPtr publicKey, SecKey.SecKeyPtr privateKey)
- Since:
- Available in iOS 2.0 and later.
-
rawSign0
protected OSStatus rawSign0(SecPadding padding, long dataToSign, long dataToSignLen, org.robovm.rt.bro.ptr.BytePtr sig, org.robovm.rt.bro.ptr.MachineSizedUIntPtr sigLen)
- Since:
- Available in iOS 2.0 and later.
-
rawVerify0
protected OSStatus rawVerify0(SecPadding padding, long signedData, long signedDataLen, long sig, long sigLen)
- Since:
- Available in iOS 2.0 and later.
-
encrypt0
protected OSStatus encrypt0(SecPadding padding, long plainText, long plainTextLen, org.robovm.rt.bro.ptr.BytePtr cipherText, org.robovm.rt.bro.ptr.MachineSizedUIntPtr cipherTextLen)
- Since:
- Available in iOS 2.0 and later.
-
decrypt0
protected OSStatus decrypt0(SecPadding padding, long cipherText, long cipherTextLen, org.robovm.rt.bro.ptr.BytePtr plainText, org.robovm.rt.bro.ptr.MachineSizedUIntPtr plainTextLen)
- Since:
- Available in iOS 2.0 and later.
-
createRandomKey
public static SecKey createRandomKey(NSDictionary parameters, NSError error)
- Since:
- Available in iOS 10.0 and later.
-
createWithData
public static SecKey createWithData(NSData keyData, NSDictionary attributes, NSError error)
- Since:
- Available in iOS 10.0 and later.
-
getBlockSize
public long getBlockSize()
- Since:
- Available in iOS 2.0 and later.
-
copyExternalRepresentation
public NSData copyExternalRepresentation(NSError error)
- Since:
- Available in iOS 10.0 and later.
-
copyAttributes
public NSDictionary copyAttributes()
- Since:
- Available in iOS 10.0 and later.
-
copyPublicKey
public SecKey copyPublicKey()
- Since:
- Available in iOS 10.0 and later.
-
createSignature
public NSData createSignature(java.lang.String algorithm, NSData dataToSign, NSError error)
- Since:
- Available in iOS 10.0 and later.
-
verifySignature
public boolean verifySignature(java.lang.String algorithm, NSData signedData, NSData signature, NSError error)
- Since:
- Available in iOS 10.0 and later.
-
createEncryptedData
public NSData createEncryptedData(java.lang.String algorithm, NSData plaintext, NSError error)
- Since:
- Available in iOS 10.0 and later.
-
createDecryptedData
public NSData createDecryptedData(java.lang.String algorithm, NSData ciphertext, NSError error)
- Since:
- Available in iOS 10.0 and later.
-
copyKeyExchangeResult
public NSData copyKeyExchangeResult(java.lang.String algorithm, SecKey publicKey, NSDictionary parameters, NSError error)
- Since:
- Available in iOS 10.0 and later.
-
isAlgorithmSupported
public boolean isAlgorithmSupported(SecKeyOperationType operation, java.lang.String algorithm)
- Since:
- Available in iOS 10.0 and later.
-
-