/** * Create an instance of {@link CTDocProtect } * */ public CTDocProtect createCTDocProtect() { return new CTDocProtect(); }
BigInteger sid = safeGetDocumentProtection().getCryptAlgorithmSid(); byte hash[] = safeGetDocumentProtection().getHash(); byte salt[] = safeGetDocumentProtection().getSalt(); BigInteger spinCount = safeGetDocumentProtection().getCryptSpinCount();
/** * Verifies the documentProtection tag inside settings.xml file * if the protection is enforced (w:enforcement="1") * and if the kind of protection equals to passed (STDocProtect.Enum editValue) * * @return true if documentProtection is enforced with option readOnly * @since 3.3.0 */ public boolean isRestrictEditingWith(STDocProtect editValue) { CTDocProtect ctDocProtect = this.jaxbElement.getDocumentProtection(); if (ctDocProtect == null) { return false; } return ctDocProtect.isEnforcement() && ctDocProtect.getEdit().equals(editValue); }
safeGetDocumentProtection().setCryptProviderType(null); safeGetDocumentProtection().setCryptAlgorithmClass(null); safeGetDocumentProtection().setCryptAlgorithmType(null); safeGetDocumentProtection().setCryptAlgorithmSid(null); safeGetDocumentProtection().setSalt(null); safeGetDocumentProtection().setCryptSpinCount(null); safeGetDocumentProtection().setHash(null); safeGetDocumentProtection().setSalt(salt); safeGetDocumentProtection().setHash(hash); safeGetDocumentProtection().setCryptSpinCount(BigInteger.valueOf(spinCount)); safeGetDocumentProtection().setCryptAlgorithmType(STAlgType.TYPE_ANY); safeGetDocumentProtection().setCryptAlgorithmClass(STAlgClass.HASH); safeGetDocumentProtection().setCryptProviderType(providerType); safeGetDocumentProtection().setCryptAlgorithmSid(BigInteger.valueOf(sid));
safeGetDocumentProtection().setCryptProviderType(null); safeGetDocumentProtection().setCryptAlgorithmClass(null); safeGetDocumentProtection().setCryptAlgorithmType(null); safeGetDocumentProtection().setCryptAlgorithmSid(null); safeGetDocumentProtection().setSalt(null); safeGetDocumentProtection().setCryptSpinCount(null); safeGetDocumentProtection().setHash(null); safeGetDocumentProtection().setSalt(salt); safeGetDocumentProtection().setHash(hash); safeGetDocumentProtection().setCryptSpinCount(BigInteger.valueOf(spinCount)); safeGetDocumentProtection().setCryptAlgorithmType(STAlgType.TYPE_ANY); safeGetDocumentProtection().setCryptAlgorithmClass(STAlgClass.HASH); safeGetDocumentProtection().setCryptProviderType(providerType); safeGetDocumentProtection().setCryptAlgorithmSid(BigInteger.valueOf(sid));
BigInteger sid = safeGetDocumentProtection().getCryptAlgorithmSid(); byte hash[] = safeGetDocumentProtection().getHash(); byte salt[] = safeGetDocumentProtection().getSalt(); BigInteger spinCount = safeGetDocumentProtection().getCryptSpinCount();
/** * Verifies the documentProtection tag inside settings.xml file * if the protection is enforced (w:enforcement="1") * and if the kind of protection equals to passed (STDocProtect.Enum editValue) * * @return true if documentProtection is enforced with option readOnly * @since 3.3.0 */ public boolean isRestrictEditingWith(STDocProtect editValue) { CTDocProtect ctDocProtect = this.jaxbElement.getDocumentProtection(); if (ctDocProtect == null) { return false; } return ctDocProtect.isEnforcement() && ctDocProtect.getEdit().equals(editValue); }
/** * Create an instance of {@link CTDocProtect } * */ public CTDocProtect createCTDocProtect() { return new CTDocProtect(); }