Package org.mozilla.jss.crypto
Class JSSOAEPParameterSpec
- java.lang.Object
-
- org.mozilla.jss.util.NativeEnclosure
-
- org.mozilla.jss.crypto.JSSOAEPParameterSpec
-
- All Implemented Interfaces:
java.lang.AutoCloseable,java.security.spec.AlgorithmParameterSpec
public class JSSOAEPParameterSpec extends NativeEnclosure implements java.security.spec.AlgorithmParameterSpec
This class is utilized by JSS to implement OAEP support. Unlike the existing OAEPParameterSpec in the JCA, this class supports NativeEnclosure, allowing it to be used within low-level JNI calls. We support copying from an existing OAEPParameterSpec instance (so use is interchangeable within JSS) and support setting members from JSS-specific types. Note that this class cannot be used with other JCA providers natively.
-
-
Field Summary
Fields Modifier and Type Field Description longhashAlglongmgfbyte[]sourceData-
Fields inherited from class org.mozilla.jss.util.NativeEnclosure
mPointer, mPointerSize
-
-
Constructor Summary
Constructors Constructor Description JSSOAEPParameterSpec(java.lang.String mdName, java.lang.String mgfName, java.security.spec.AlgorithmParameterSpec mgfSpec, javax.crypto.spec.PSource pSrc)JSSOAEPParameterSpec(javax.crypto.spec.OAEPParameterSpec copy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidacquireNativeResources()Allocate native resources, setting mPointer and mPointerSize as appropriate.protected voidreleaseNativeResources()Called to deallocate native resources; note that mPointer.close() is called afterwards.voidsetDigestAlgorithm(long algo)voidsetDigestAlgorithm(java.lang.String algo)voidsetDigestAlgorithm(DigestAlgorithm algo)voidsetMaskGenAlgorithm(java.lang.String algo)voidsetMaskGenAlgorithmType(long algo)voidsetMaskGenAlgorithmType(java.lang.String algo)voidsetMaskGenAlgorithmType(java.security.spec.AlgorithmParameterSpec algo)voidsetPSource(byte[] data)voidsetPSource(javax.crypto.spec.PSource spec)-
Methods inherited from class org.mozilla.jss.util.NativeEnclosure
close, finalize, open
-
-
-
-
Method Detail
-
setDigestAlgorithm
public void setDigestAlgorithm(java.lang.String algo) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
setDigestAlgorithm
public void setDigestAlgorithm(DigestAlgorithm algo) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
setDigestAlgorithm
public void setDigestAlgorithm(long algo) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
setMaskGenAlgorithm
public void setMaskGenAlgorithm(java.lang.String algo) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
setMaskGenAlgorithmType
public void setMaskGenAlgorithmType(java.lang.String algo) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
setMaskGenAlgorithmType
public void setMaskGenAlgorithmType(java.security.spec.AlgorithmParameterSpec algo) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
setMaskGenAlgorithmType
public void setMaskGenAlgorithmType(long algo) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
setPSource
public void setPSource(javax.crypto.spec.PSource spec) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
setPSource
public void setPSource(byte[] data) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
acquireNativeResources
protected void acquireNativeResources() throws java.lang.ExceptionDescription copied from class:NativeEnclosureAllocate native resources, setting mPointer and mPointerSize as appropriate.- Specified by:
acquireNativeResourcesin classNativeEnclosure- Throws:
java.lang.Exception
-
releaseNativeResources
protected void releaseNativeResources() throws java.lang.ExceptionDescription copied from class:NativeEnclosureCalled to deallocate native resources; note that mPointer.close() is called afterwards. If mPointer.close() should be a no-op, extend from StaticVoidRef and do any required cleanup here.- Specified by:
releaseNativeResourcesin classNativeEnclosure- Throws:
java.lang.Exception
-
-